public interface Message
TextChannels
and from PrivateChannels
.Modifier and Type | Interface and Description |
---|---|
static class |
Message.Attachment
Represents a
Message file attachment. |
Modifier and Type | Method and Description |
---|---|
void |
deleteMessage()
Deletes this Message from the server.
|
java.util.List<Message.Attachment> |
getAttachments()
An unmodifiable list of
Attachment that are attached to this message.Most likely this will only ever be 1 Attachment at most. |
User |
getAuthor()
The author of this Message
|
java.lang.String |
getChannelId()
Returns the Id of the Channel this Message was sent in.
|
java.lang.String |
getContent()
The textual content of this message.
|
java.time.OffsetDateTime |
getEditedTimestamp()
Gives a copy of the Object holding the time this message was last recently updated
If this message was never updated (
isEdited() returns false), this will be NULL |
java.lang.String |
getId()
The Id of this Message
|
JDA |
getJDA()
Returns the
JDA instance of this Message |
java.util.List<TextChannel> |
getMentionedChannels()
A immutable list of all mentioned
TextChannels . |
java.util.List<User> |
getMentionedUsers()
A immutable list of all mentioned users.
|
java.lang.String |
getRawContent()
The raw textual content of this message.
|
java.lang.String |
getStrippedContent()
The content, with all its formatting characters stripped.
|
java.time.OffsetDateTime |
getTime()
Gives a copy of the Object holding the time this message was originally sent
|
boolean |
isEdited()
Returns true, if this Message was edited as least once
|
boolean |
isPrivate()
Checks, whether this Message was sent in a
PrivateChannel (Private Message),
or in a TextChannel (sent in Guild channel) |
boolean |
isTTS()
Is this Message supposed to be TTS (Text-to-speach)
|
boolean |
mentionsEveryone()
Is this Message mentioning everyone using @everyone?
In
PrivateChannel's , this always returns false |
Message |
updateMessage(java.lang.String newContent)
Edits this Messages content to the provided String.
|
java.lang.String getId()
java.util.List<User> getMentionedUsers()
PrivateChannel's
, this always returns an empty Listjava.util.List<TextChannel> getMentionedChannels()
TextChannels
. if none was mentioned, this list is empty
In PrivateChannel's
, this always returns an empty Listboolean mentionsEveryone()
PrivateChannel's
, this always returns falsejava.time.OffsetDateTime getTime()
boolean isEdited()
java.time.OffsetDateTime getEditedTimestamp()
isEdited()
returns false), this will be NULLUser getAuthor()
java.lang.String getContent()
getRawContent()
insteadjava.lang.String getRawContent()
java.lang.String getStrippedContent()
boolean isPrivate()
PrivateChannel
(Private Message),
or in a TextChannel
(sent in Guild channel)java.lang.String getChannelId()
TextChannel
or a PrivateChannel
To get the corresponding channel, you can use JDA.getTextChannelById(String)
or JDA.getPrivateChannelById(String)
(Hint: isPrivate()
could be helpful!)java.util.List<Message.Attachment> getAttachments()
Attachment
that are attached to this message.Attachment
at most.Attachments
.boolean isTTS()
Message updateMessage(java.lang.String newContent)
newContent
- the new content of the Messagevoid deleteMessage()
MESSAGE_MANAGE Permission
will have no effect