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 = true, bool filter = true, size_t maxLength = 2000)

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.

popBack
string popBack()

Remove the last line in the buffer

Properties

contents
string contents [@property getter]

Formatted contents of this message.

length
size_t length [@property getter]

Current length of this message (without formatting)

maxLength
size_t maxLength [@property getter]

Max length of this message (subtracting for formatting)

Meta