MessageBuffer

Utility class for constructing messages that can be sent over discord, allowing for inteligent limiting of size and stripping of formatting characters.

Constructors

this
this(bool codeBlock, bool filter, size_t maxLength)

Members

Functions

append
bool append(string line)

Append a line to this message. Returns false if the buffer is full.

appendf
bool appendf(string fmt, T args)

Format and append a line to this message. Returns false if the buffer is full.

contents
string contents()

Formatted contents of this message.

getContents
immutable(string) getContents()

Undocumented in source. Be warned that the author may not have intended to support it.

length
size_t length()

Current length of this message (without formatting)

maxLength
size_t maxLength()

Max length of this message (subtracting for formatting)

popBack
string popBack()

Remove the last line in the buffer

Inherited Members

From BaseSendable

getEmbed
immutable(MessageEmbed) getEmbed()

Get embed from sendable

getContents
immutable(string) getContents()

Get contents from sendable

getNonce
immutable(string) getNonce()

Get nonce of sendable

getTTS
immutable(bool) getTTS()

Find whether the sendable has TTS (text-to-speech) enabled

Meta