public class MessageCreateSpec extends Object implements Spec<MultipartRequest>
Messages
to TextChannels
. Clients using this spec must
have connected to gateway at least once.Constructor and Description |
---|
MessageCreateSpec() |
Modifier and Type | Method and Description |
---|---|
MessageCreateSpec |
addFile(String fileName,
InputStream file)
Adds a file as attachment to the created
Message . |
MessageCreateSpec |
addFileSpoiler(String fileName,
InputStream file)
Adds a spoiler file as attachment to the created
Message . |
MultipartRequest |
asRequest() |
MessageCreateSpec |
setContent(String content)
Sets the created
Message contents, up to 2000 characters. |
MessageCreateSpec |
setEmbed(Consumer<? super EmbedCreateSpec> spec)
|
MessageCreateSpec |
setNonce(Snowflake nonce)
Sets a nonce that can be used for optimistic message sending.
|
MessageCreateSpec |
setTts(boolean tts)
Sets whether the created
Message is a TTS message. |
public MessageCreateSpec setContent(String content)
Message
contents, up to 2000 characters.content
- The message contents.public MessageCreateSpec setNonce(Snowflake nonce)
nonce
- An identifier.public MessageCreateSpec setTts(boolean tts)
Message
is a TTS message.tts
- If this message is a TTS message.public MessageCreateSpec setEmbed(Consumer<? super EmbedCreateSpec> spec)
spec
- An EmbedCreateSpec
consumer used to attach rich content when creating a message.public MessageCreateSpec addFile(String fileName, InputStream file)
Message
.fileName
- The filename used in the file being sent.file
- The file contents.public MessageCreateSpec addFileSpoiler(String fileName, InputStream file)
Message
.fileName
- The filename used in the file being sent.file
- The file contents.public MultipartRequest asRequest()
asRequest
in interface Spec<MultipartRequest>