#[non_exhaustive]pub enum MessageType {
Show 39 variants
Default,
RecipientAdd,
RecipientRemove,
Call,
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified,
GuildDiscoveryRequalified,
GuildDiscoveryGracePeriodInitialWarning,
GuildDiscoveryGracePeriodFinalWarning,
ThreadCreated,
Reply,
ChatInputCommand,
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
RoleSubscriptionPurchase,
InteractionPremiumUpsell,
StageStart,
StageEnd,
StageSpeaker,
StageRaiseHand,
StageTopic,
GuildApplicationPremiumSubscription,
GuildIncidentAlertModeEnabled,
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification,
PollResult,
Unknown(u8),
}Expand description
The type of a message.
discord.js counterpart: MessageType (re-exported from discord-api-types).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default
A regular message.
RecipientAdd
A recipient was added to a group DM.
RecipientRemove
A recipient was removed from a group DM.
Call
A call was started.
ChannelNameChange
A channel’s name was changed.
ChannelIconChange
A channel’s icon was changed.
ChannelPinnedMessage
A message was pinned.
UserJoin
A member joined the guild.
GuildBoost
A member boosted the guild.
GuildBoostTier1
A boost brought the guild to tier 1.
GuildBoostTier2
A boost brought the guild to tier 2.
GuildBoostTier3
A boost brought the guild to tier 3.
ChannelFollowAdd
A channel follow (announcement channel subscription) was added.
GuildDiscoveryDisqualified
The guild was disqualified from Server Discovery.
GuildDiscoveryRequalified
The guild was requalified for Server Discovery.
GuildDiscoveryGracePeriodInitialWarning
Initial warning of the Server Discovery grace period.
GuildDiscoveryGracePeriodFinalWarning
Final warning of the Server Discovery grace period.
ThreadCreated
A thread was created from a message.
Reply
A reply to another message.
ChatInputCommand
The response to a slash (chat input) command.
ThreadStarterMessage
The first message of a thread, referencing the message the thread was started from.
GuildInviteReminder
A reminder to invite people to the guild.
ContextMenuCommand
The response to a context menu command.
AutoModerationAction
An auto moderation action was taken.
RoleSubscriptionPurchase
A role subscription was purchased.
InteractionPremiumUpsell
An upsell for a premium interaction.
StageStart
A stage started.
StageEnd
A stage ended.
StageSpeaker
A member became a stage speaker.
StageRaiseHand
A member raised their hand on a stage.
Not listed in the official documentation; present in discord-api-types.
StageTopic
A stage’s topic was changed.
GuildApplicationPremiumSubscription
A guild application premium subscription was purchased.
GuildIncidentAlertModeEnabled
Incident alert mode (raid protection) was enabled.
GuildIncidentAlertModeDisabled
Incident alert mode (raid protection) was disabled.
GuildIncidentReportRaid
A raid was reported.
GuildIncidentReportFalseAlarm
A raid report was marked as a false alarm.
PurchaseNotification
A purchase notification.
PollResult
The results of a poll.
Unknown(u8)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
MessageType::from over constructing this variant directly.
Implementations§
Source§impl MessageType
impl MessageType
Sourcepub const fn value(self) -> u8
pub const fn value(self) -> u8
Returns the raw integer value Discord uses for this variant.
discord.js counterpart: the enum’s numeric value in discord-api-types.
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Returns true if this is a value the library does not know about.
discord.js counterpart: none (discord.js passes unknown numbers through).
Sourcepub const fn from_value(value: u8) -> Self
pub const fn from_value(value: u8) -> Self
Converts a raw value into the matching variant, or Self::Unknown.
discord.js counterpart: none (discord.js passes unknown numbers through).
Source§impl MessageType
impl MessageType
Sourcepub const fn is_deletable(self) -> bool
pub const fn is_deletable(self) -> bool
Returns true if messages of this type can be deleted.
Based on the “Deletable” column of the Discord documentation. Unknown types are assumed to
be deletable. AutoModerationAction messages additionally require the MANAGE_MESSAGES
permission.
discord.js counterpart: Message#deletable, for the type part.