Message.Attachment
Constructor and Description |
---|
MessageImpl(java.lang.String id,
JDAImpl api) |
Modifier and Type | Method and Description |
---|---|
void |
deleteMessage()
Deletes this Message from the server.
|
boolean |
equals(java.lang.Object o) |
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 (
Message.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
|
int |
hashCode() |
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 |
MessageImpl |
setAttachments(java.util.List<Message.Attachment> attachments) |
MessageImpl |
setAuthor(User author) |
MessageImpl |
setChannelId(java.lang.String channelId) |
MessageImpl |
setContent(java.lang.String content) |
MessageImpl |
setEditedTime(java.time.OffsetDateTime editedTime) |
MessageImpl |
setIsPrivate(boolean isPrivate) |
MessageImpl |
setMentionedChannels(java.util.List<TextChannel> mentionedChannels) |
MessageImpl |
setMentionedUsers(java.util.List<User> mentionedUsers) |
MessageImpl |
setMentionsEveryone(boolean mentionsEveryone) |
MessageImpl |
setTime(java.time.OffsetDateTime time) |
MessageImpl |
setTTS(boolean TTS) |
java.lang.String |
toString() |
Message |
updateMessage(java.lang.String newContent)
Edits this Messages content to the provided String.
|
public MessageImpl(java.lang.String id, JDAImpl api)
public JDA getJDA()
Message
JDA
instance of this Messagepublic java.lang.String getId()
Message
public java.util.List<User> getMentionedUsers()
Message
PrivateChannel's
, this always returns an empty ListgetMentionedUsers
in interface Message
public java.util.List<TextChannel> getMentionedChannels()
Message
TextChannels
. if none was mentioned, this list is empty
In PrivateChannel's
, this always returns an empty ListgetMentionedChannels
in interface Message
public boolean mentionsEveryone()
Message
PrivateChannel's
, this always returns falsementionsEveryone
in interface Message
public java.time.OffsetDateTime getTime()
Message
public boolean isEdited()
Message
public java.time.OffsetDateTime getEditedTimestamp()
Message
Message.isEdited()
returns false), this will be NULLgetEditedTimestamp
in interface Message
public User getAuthor()
Message
public java.lang.String getContent()
Message
Message.getRawContent()
insteadgetContent
in interface Message
public java.lang.String getRawContent()
Message
getRawContent
in interface Message
public java.lang.String getChannelId()
Message
TextChannel
or a PrivateChannel
To get the corresponding channel, you can use JDA.getTextChannelById(String)
or JDA.getPrivateChannelById(String)
(Hint: Message.isPrivate()
could be helpful!)getChannelId
in interface Message
public java.util.List<Message.Attachment> getAttachments()
Message
Attachment
that are attached to this message.Attachment
at most.getAttachments
in interface Message
Attachments
.public boolean isPrivate()
Message
PrivateChannel
(Private Message),
or in a TextChannel
(sent in Guild channel)public boolean isTTS()
Message
public Message updateMessage(java.lang.String newContent)
Message
updateMessage
in interface Message
newContent
- the new content of the Messagepublic void deleteMessage()
Message
MESSAGE_MANAGE Permission
will have no effectdeleteMessage
in interface Message
public MessageImpl setMentionedUsers(java.util.List<User> mentionedUsers)
public MessageImpl setMentionedChannels(java.util.List<TextChannel> mentionedChannels)
public MessageImpl setMentionsEveryone(boolean mentionsEveryone)
public MessageImpl setTTS(boolean TTS)
public MessageImpl setTime(java.time.OffsetDateTime time)
public MessageImpl setEditedTime(java.time.OffsetDateTime editedTime)
public MessageImpl setAuthor(User author)
public MessageImpl setIsPrivate(boolean isPrivate)
public MessageImpl setChannelId(java.lang.String channelId)
public MessageImpl setContent(java.lang.String content)
public MessageImpl setAttachments(java.util.List<Message.Attachment> attachments)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStrippedContent()
Message
getStrippedContent
in interface Message