Struct discord_flows::model::Message
source · pub struct Message {Show 30 fields
pub id: MessageId,
pub channel_id: ChannelId,
pub author: User,
pub content: String,
pub timestamp: Timestamp,
pub edited_timestamp: Option<Timestamp>,
pub tts: bool,
pub mention_everyone: bool,
pub mentions: Vec<User, Global>,
pub mention_roles: Vec<RoleId, Global>,
pub mention_channels: Vec<ChannelMention, Global>,
pub attachments: Vec<Attachment, Global>,
pub embeds: Vec<Embed, Global>,
pub reactions: Vec<MessageReaction, Global>,
pub nonce: Value,
pub pinned: bool,
pub webhook_id: Option<WebhookId>,
pub kind: MessageType,
pub activity: Option<MessageActivity>,
pub application: Option<MessageApplication>,
pub application_id: Option<ApplicationId>,
pub message_reference: Option<MessageReference>,
pub flags: Option<MessageFlags>,
pub referenced_message: Option<Box<Message, Global>>,
pub interaction: Option<MessageInteraction>,
pub thread: Option<GuildChannel>,
pub components: Vec<ActionRow, Global>,
pub sticker_items: Vec<StickerItem, Global>,
pub guild_id: Option<GuildId>,
pub member: Option<PartialMember>,
}
Expand description
A representation of a message over a guild’s text channel, a group, or a private channel.
Discord docs with some extra fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: MessageId
The unique Id of the message. Can be used to calculate the creation date of the message.
channel_id: ChannelId
The Id of the Channel
that the message was sent to.
The user that sent the message.
content: String
The content of the message.
timestamp: Timestamp
Initial message creation timestamp, calculated from its Id.
edited_timestamp: Option<Timestamp>
The timestamp of the last time the message was updated, if it was.
tts: bool
Indicator of whether the command is to be played back via text-to-speech.
In the client, this is done via the /tts
slash command.
mention_everyone: bool
Indicator of whether the message mentions everyone.
mentions: Vec<User, Global>
Array of users mentioned in the message.
mention_roles: Vec<RoleId, Global>
Array of Role
s’ Ids mentioned in the message.
mention_channels: Vec<ChannelMention, Global>
Channels specifically mentioned in this message.
Note:
Not all channel mentions in a message will appear in Self::mention_channels
. Only textual
channels that are visible to everyone in a lurkable guild will ever be included.
A lurkable guild is one that allows users to read public channels in a server without actually joining the server. It also allows users to look at these channels without being logged in to Discord.
Only crossposted messages (via Channel Following) currently include Self::mention_channels
at
all. If no mentions in the message meet these requirements, this field will not be sent.
Refer to Discord’s documentation for more information.
attachments: Vec<Attachment, Global>
An vector of the files attached to a message.
embeds: Vec<Embed, Global>
Array of embeds sent with the message.
reactions: Vec<MessageReaction, Global>
Array of reactions performed on the message.
nonce: Value
Non-repeating number used for ensuring message order.
pinned: bool
Indicator of whether the message is pinned.
webhook_id: Option<WebhookId>
The Id of the webhook that sent this message, if one did.
kind: MessageType
Indicator of the type of message this is, i.e. whether it is a regular message or a system message.
activity: Option<MessageActivity>
Sent with Rich Presence-related chat embeds.
application: Option<MessageApplication>
Sent with Rich Presence-related chat embeds.
application_id: Option<ApplicationId>
If the message is an Interaction or application-owned webhook, this is the id of the application.
message_reference: Option<MessageReference>
Reference data sent with crossposted messages.
flags: Option<MessageFlags>
Bit flags describing extra features of the message.
referenced_message: Option<Box<Message, Global>>
The message that was replied to using this message.
interaction: Option<MessageInteraction>
Sent if the message is a response to an Interaction
.
thread: Option<GuildChannel>
The thread that was started from this message, includes thread member object.
components: Vec<ActionRow, Global>
The components of this message
sticker_items: Vec<StickerItem, Global>
Array of message sticker item objects.
guild_id: Option<GuildId>
The Id of the Guild
that the message was sent in. This value will
only be present if this message was received over the gateway.
member: Option<PartialMember>
A partial amount of data about the user’s member data, if this message was sent in a guild.