Class MessageSnapshot

java.lang.Object
net.dv8tion.jda.api.entities.messages.MessageSnapshot

public class MessageSnapshot extends Object
Snapshot of a forwarded message.
  • Constructor Details

  • Method Details

    • getType

      @Nonnull public MessageType getType()
      The MessageType of the forwarded message.
      Returns:
      The MessageType
    • getMentions

      @Nonnull public Mentions 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

      @Nullable public OffsetDateTime 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

      @Nonnull public String getContentRaw()
      The raw content of the message, including markdown and mentions.
      Returns:
      The raw message content.
    • getInvites

      @Nonnull public @Unmodifiable List<String> getInvites()
      Invite codes found in the message content.
      Returns:
      The invite codes
    • getAttachments

      @Nonnull public @Unmodifiable List<Message.Attachment> getAttachments()
      Message attachments of the forwarded message.
      Returns:
      Immutable List of Message.Attachment
    • getEmbeds

      @Nonnull public @Unmodifiable List<MessageEmbed> getEmbeds()
      Message embeds of the forwarded message.
      Returns:
      Immutable List of MessageEmbed
    • getComponents

      @Nonnull public @Unmodifiable List<LayoutComponent> getComponents()
      Components of the forwarded message.

      Buttons and other interactive components are non-functional in forwarded messages.

      Returns:
      Immutable List of LayoutComponent
    • getStickers

      @Nonnull public @Unmodifiable List<StickerItem> getStickers()
      Stickers of the forwarded message.
      Returns:
      Immutable List of StickerItem
    • getFlagsRaw

      public long getFlagsRaw()
      The raw message flags of the forwarded message.
      Returns:
      The message flags
    • getFlags

      @Nonnull public EnumSet<Message.MessageFlag> getFlags()
      The message flags fo the forwarded message.
      Returns:
      EnumSet of Message.MessageFlag