public interface Message extends ISnowflake
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 |
---|---|
RestAction<java.lang.Void> |
deleteMessage()
Deletes this Message from the server.
|
RestAction<Message> |
editMessage(Message newContent)
Edits this Messages content to be the content of the provide message.
|
RestAction<Message> |
editMessage(java.lang.String newContent)
Edits this Messages content to the provided String.
|
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
|
MessageChannel |
getChannel()
Returns the
MessageChannel that this message was sent in |
ChannelType |
getChannelType() |
java.lang.String |
getContent()
The textual content of this message.
|
java.time.OffsetDateTime |
getEditedTime()
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.util.List<MessageEmbed> |
getEmbeds()
An unmodifiable list of
MessageEmbeds that are available to this message. |
java.util.List<Emote> |
getEmotes()
All emotes used in this Message.
|
Group |
getGroup() |
Guild |
getGuild() |
JDA |
getJDA()
Returns the
JDA instance of this Message |
java.util.List<TextChannel> |
getMentionedChannels()
A immutable list of all mentioned
TextChannels . |
java.util.List<Role> |
getMentionedRoles()
A immutable list of all mentioned
Roles . |
java.util.List<User> |
getMentionedUsers()
A immutable list of all mentioned users.
|
PrivateChannel |
getPrivateChannel() |
java.lang.String |
getRawContent()
The raw textual content of this message.
|
java.lang.String |
getStrippedContent()
The content, with all its formatting characters stripped.
|
TextChannel |
getTextChannel() |
MessageType |
getType()
This specifies the type of Message sent.
|
boolean |
isEdited()
Returns true, if this Message was edited as least once
|
boolean |
isFromType(ChannelType type) |
boolean |
isMentioned(User user)
Checks if given user was mentioned in this message in any way (@User, @everyone, @here).
|
boolean |
isPinned()
Whether or not this Message has been pinned in its parent channel.
|
boolean |
isTTS()
Is this Message supposed to be TTS (Text-to-speach)
|
boolean |
isWebhookMessage() |
boolean |
mentionsEveryone()
Is this Message mentioning everyone using @everyone or @here?
In
PrivateChannel's , this always returns false |
RestAction<java.lang.Void> |
pin()
This is a shortcut method to
MessageChannel.pinMessageById(String) .If this method returns true, then the action was successful and this Message's isPinned() will now return true. |
RestAction<java.lang.Void> |
unpin()
This is a shortcut method to
MessageChannel.unpinMessageById(String) .If this method returns true, then the action was successful and this Message's isPinned() will now return false. |
getCreationTime, getId
java.util.List<User> getMentionedUsers()
PrivateChannel's
, this always returns an empty Listboolean isMentioned(User user)
user
- The user to check on.java.util.List<TextChannel> getMentionedChannels()
TextChannels
. if none were mentioned, this list is empty
In PrivateChannel's
, this always returns an empty Listjava.util.List<Role> getMentionedRoles()
Roles
. if none were mentioned, this list is empty
In PrivateChannel's
, this always returns an empty Listboolean mentionsEveryone()
PrivateChannel's
, this always returns falseboolean isEdited()
java.time.OffsetDateTime getEditedTime()
isEdited()
returns false), this will be NULLUser getAuthor()
java.lang.String getContent()
getRawContent()
insteadjava.lang.String getRawContent()
java.lang.String getStrippedContent()
boolean isFromType(ChannelType type)
ChannelType getChannelType()
boolean isWebhookMessage()
MessageChannel getChannel()
MessageChannel
that this message was sent inPrivateChannel getPrivateChannel()
Group getGroup()
TextChannel getTextChannel()
Guild getGuild()
java.util.List<Message.Attachment> getAttachments()
Attachment
that are attached to this message.Attachment
at most.Attachments
.java.util.List<MessageEmbed> getEmbeds()
MessageEmbeds
that are available to this message.java.util.List<Emote> getEmotes()
This may or may not contain fake Emotes.
To check whether an Emote is fake you can test if Emote#getGuild
returns null.
boolean isTTS()
RestAction<Message> editMessage(java.lang.String newContent)
newContent
- the new content of the MessageRestAction<Message> editMessage(Message newContent)
newContent
- the new content of the MessageRestAction<java.lang.Void> deleteMessage()
MESSAGE_MANAGE Permission
will have no effectRestAction
JDA getJDA()
JDA
instance of this Messageboolean isPinned()
RestAction<java.lang.Void> pin()
MessageChannel.pinMessageById(String)
.isPinned()
will now return true.RestAction<java.lang.Void> unpin()
MessageChannel.unpinMessageById(String)
.isPinned()
will now return false.MessageType getType()