Interface MessageData

All Known Subinterfaces:
ForumPostAction, MessageCreateAction, MessageCreateRequest<R>, MessageEditAction, MessageEditCallbackAction, MessageEditRequest<R>, MessageRequest<R>, ReplyCallbackAction, WebhookMessageCreateAction<T>, WebhookMessageEditAction<T>
All Known Implementing Classes:
AbstractMessageBuilder, MessageCreateBuilder, MessageCreateData, MessageEditBuilder, MessageEditData

public interface MessageData
Represents data relevant to all message requests.
  • Method Details

    • getContent

      @Nonnull String getContent()
      The configured message content, this is the opposite for MessageRequest.setContent(String) and only returns what was set using that setter.

      For message edit requests, this will not be the current content of the message.

      Returns:
      The currently configured content, or an empty string if none was set yet
      See Also:
    • getEmbeds

      @Nonnull List<MessageEmbed> getEmbeds()
      The configured message embeds, this is the opposite of MessageRequest.setEmbeds(Collection) and only returns what was set using that setter.

      For message edit requests, this will not be the current embeds of the message.

      Returns:
      The currently configured embeds, or an empty list if none were set yet
      See Also:
    • getComponents

      @Nonnull List<LayoutComponent> getComponents()
      The configured message components, this is the opposite of MessageRequest.setComponents(Collection) and only returns what was set using that setter.

      For message edit requests, this will not be the current components of the message.

      Returns:
      The currently configured components, or an empty list if none were set yet
      See Also:
    • getAttachments

      @Nonnull List<? extends AttachedFile> getAttachments()
      The configured message attachments as AttachedFile, this is the opposite of MessageRequest.setFiles(Collection) and only returns what was set using that setter.

      For message edit requests, this will not be the current file attachments of the message.

      Returns:
      The currently configured attachments, or an empty list if none were set yet
      See Also:
    • isSuppressEmbeds

      boolean isSuppressEmbeds()
      Whether embeds will be suppressed on this message.
      Returns:
      True, if embeds are suppressed
    • getMentionedUsers

      @Nonnull Set<String> getMentionedUsers()
      The IDs for users which are allowed to be mentioned, or an empty list.
      Returns:
      The user IDs which are mention whitelisted
    • getMentionedRoles

      @Nonnull Set<String> getMentionedRoles()
      The IDs for roles which are allowed to be mentioned, or an empty list.
      Returns:
      The role IDs which are mention whitelisted
    • getAllowedMentions

      @Nonnull EnumSet<Message.MentionType> getAllowedMentions()
      The mention types which are whitelisted.
      Returns:
      The mention types which can be mentioned by this message
    • isMentionRepliedUser

      boolean isMentionRepliedUser()
      Whether this message would mention a user, if it is sent as a reply.
      Returns:
      True, if this would mention with the reply