Represents a text message received from Discord. This represents messages received from MessageChannels.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/discord-jda/JDA/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Message interface provides access to all message data including content, attachments, embeds, and reactions. Messages are immutable - JDA does not track changes to messages.Key Properties
Message Content
The raw textual content of this message. Does not resolve mentions.Requires
MESSAGE_CONTENT intent.The textual content with mentions resolved to be visually like the Discord client.Requires
MESSAGE_CONTENT intent.Gets the textual content and strips markdown formatting characters.Requires
MESSAGE_CONTENT intent.Author Information
The author of this Message.
Returns the author of this Message as a Member.Returns
null if the message was not sent in a guild, or if sent by a webhook.Indicates if this Message was sent by a Webhook or an app, instead of a User.
Channel and Guild
Returns the MessageChannel that this message was sent in.
Returns the GuildMessageChannel that this message was sent in if it was sent in a Guild.
Returns the Guild that this message was sent in.
Whether this message was sent in a Guild.
Gets the ChannelType that this message was received from.
Attachments and Embeds
An immutable list of Attachments that are attached to this message.Requires
MESSAGE_CONTENT intent.An immutable list of MessageEmbeds that are part of this Message.Requires
MESSAGE_CONTENT intent.Components and Interactions
Layouts of interactive components, usually ActionRows.Requires
MESSAGE_CONTENT intent.All buttons attached to this message.
Reactions
All MessageReactions that are on this Message.
Metadata
The time this message was created.
Returns whether or not this Message has been edited before.
Provides the OffsetDateTime defining when this Message was last edited.Returns
null if the message has never been edited.Returns the jump-to URL for this message. Clicking this URL in Discord will jump to the message.
Whether this message is pinned in its channel.
References
Returns the MessageReference for this Message.Returns
null if this message has no reference.The referenced message for replies.Returns
null if not a reply or if the referenced message wasn’t loaded.Mentions
The Mentions used in this message.Includes Members, GuildChannels, Roles, and CustomEmojis.
Message Actions
Editing
Edits this message and updates the content.
Edits this message using the provided MessageEditData.
Edits this message using the provided MessageEmbeds.
Edits this message using the provided components.
Deletion
Deletes this message from the channel.
Reactions
Adds a reaction to this message.
Removes the bot’s reaction from this message.
Removes all reactions from this message.
Pinning
Pins this message in its channel.
Unpins this message from its channel.
Replies
Replies to this message with the provided content.
Replies to this message with the provided MessageCreateData.
Constants
The maximum amount of characters sendable in one message:
2000The maximum sendable file size:
10485760 (10 MiB)The maximum amount of files sendable within a single message:
10The maximum amount of Embeds that can be added to one message:
10The maximum amount of reactions that can be added to one message:
20