Class MessageSnapshot
java.lang.Object
net.dv8tion.jda.api.entities.messages.MessageSnapshot
Snapshot of a forwarded message.
-
Constructor Summary
ConstructorDescriptionMessageSnapshot
(MessageType type, Mentions mentions, OffsetDateTime editTime, String content, List<Message.Attachment> attachments, List<MessageEmbed> embeds, List<LayoutComponent> components, List<StickerItem> stickers, long flags) -
Method Summary
Modifier and TypeMethodDescription@Unmodifiable List<Message.Attachment>
Message attachments of the forwarded message.@Unmodifiable List<LayoutComponent>
Components of the forwarded message.The raw content of the message, including markdown and mentions.@Unmodifiable List<MessageEmbed>
Message embeds of the forwarded message.getFlags()
The message flags fo the forwarded message.long
The raw message flags of the forwarded message.Invite codes found in the message content.The mentions of the forwarded message.@Unmodifiable List<StickerItem>
Stickers of the forwarded message.The last time the forwarded message was edited before being forwarded.getType()
TheMessageType
of the forwarded message.boolean
isEdited()
Whether the forwarded message was edited.
-
Constructor Details
-
MessageSnapshot
public MessageSnapshot(MessageType type, Mentions mentions, OffsetDateTime editTime, String content, List<Message.Attachment> attachments, List<MessageEmbed> embeds, List<LayoutComponent> components, List<StickerItem> stickers, long flags)
-
-
Method Details
-
getType
TheMessageType
of the forwarded message.- Returns:
- The
MessageType
-
getMentions
The mentions of the forwarded message.Mentions are only used for resolving users and roles in a forwarded message. Mentions for cross-guild forwarded messages are usually not resolved.
- Returns:
Mentions
-
isEdited
public boolean isEdited()Whether the forwarded message was edited.Since this is a snapshot, the edited timestamp is only relevant to the time it was forwarded. If the message is edited after the fact, this is not updated.
- Returns:
- True, if the message was edited when it was forwarded
-
getTimeEdited
The last time the forwarded message was edited before being forwarded.Since this is a snapshot, the edited timestamp is only relevant to the time it was forwarded. If the message is edited after the fact, this is not updated.
- Returns:
OffsetDateTime
when the message was edited (up to the time it was forwarded)
-
getContentRaw
The raw content of the message, including markdown and mentions.- Returns:
- The raw message content.
-
getInvites
Invite codes found in the message content.- Returns:
- The invite codes
-
getAttachments
Message attachments of the forwarded message.- Returns:
- Immutable
List
ofMessage.Attachment
-
getEmbeds
Message embeds of the forwarded message.- Returns:
- Immutable
List
ofMessageEmbed
-
getComponents
Components of the forwarded message.Buttons and other interactive components are non-functional in forwarded messages.
- Returns:
- Immutable
List
ofLayoutComponent
-
getStickers
Stickers of the forwarded message.- Returns:
- Immutable
List
ofStickerItem
-
getFlagsRaw
public long getFlagsRaw()The raw message flags of the forwarded message.- Returns:
- The message flags
-
getFlags
The message flags fo the forwarded message.- Returns:
EnumSet
ofMessage.MessageFlag
-