public class MessageBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MessageBuilder.Formatting
Holds the Available formatting used in
appendString(String, Formatting...) |
Constructor and Description |
---|
MessageBuilder() |
Modifier and Type | Method and Description |
---|---|
MessageBuilder |
appendCodeBlock(java.lang.String text,
java.lang.String language)
Appends a code-block to the Message
|
MessageBuilder |
appendEveryoneMention()
Appends a @everyone mention to the Message
|
MessageBuilder |
appendMention(TextChannel channel)
Appends a channel mention to the Message.
|
MessageBuilder |
appendMention(User user)
Appends a mention to the Message
|
MessageBuilder |
appendString(java.lang.String text)
Appends a string to the Message
|
MessageBuilder |
appendString(java.lang.String text,
MessageBuilder.Formatting... format)
Appends a formatted string to the Message
|
Message |
build()
Creates a
Message object from this Builder |
int |
getLength()
|
MessageBuilder |
setTTS(boolean tts)
Makes the created Message a TTS message
|
public MessageBuilder setTTS(boolean tts)
tts
- whether the created Message should be a tts messagepublic MessageBuilder appendString(java.lang.String text)
text
- the text to appendpublic MessageBuilder appendString(java.lang.String text, MessageBuilder.Formatting... format)
text
- the text to appendformat
- the format(s) to apply to the textpublic MessageBuilder appendCodeBlock(java.lang.String text, java.lang.String language)
text
- the code to appendlanguage
- the language of the code. If unknown use an empty stringpublic MessageBuilder appendMention(User user)
user
- the user to mentionpublic MessageBuilder appendEveryoneMention()
public MessageBuilder appendMention(TextChannel channel)
channel
- the TextChannel to mentionpublic int getLength()
Message
when build()
is called.0
or greater than 2000
when build()
is called, an exception
will be raised.public Message build()
Message
object from this BuilderMessage
java.lang.UnsupportedOperationException
-