#[non_exhaustive]pub enum MessageType {
Show 36 variants
Regular,
RecipientAdd,
RecipientRemove,
Call,
ChannelNameChange,
ChannelIconChange,
ChannelMessagePinned,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified,
GuildDiscoveryRequalified,
GuildDiscoveryGracePeriodInitialWarning,
GuildDiscoveryGracePeriodFinalWarning,
ThreadCreated,
Reply,
ChatInputCommand,
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
RoleSubscriptionPurchase,
InteractionPremiumUpsell,
StageStart,
StageEnd,
StageSpeaker,
StageTopic,
GuildApplicationPremiumSubscription,
GuildIncidentAlertModeEnabled,
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportRaidFalseAlarm,
Unknown(u8),
}
Expand description
Type of a Message
.
Refer to Discord Docs/Message Types for more information.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Regular
Regular message.
RecipientAdd
System message denoting a recipient has been added to a group.
RecipientRemove
System message denoting a recipient has been removed from a group.
Call
System message denoting a call state, e.g. missed, started.
ChannelNameChange
System message denoting a channel’s name has been changed.
ChannelIconChange
System message denoting a channel’s icon has been changed.
ChannelMessagePinned
System message denoting a message has been pinned.
UserJoin
System message denoting a member has joined a guild.
GuildBoost
System message denoting a user nitro boosted a guild.
GuildBoostTier1
System message denoting a user nitro boosted a guild to level 1.
GuildBoostTier2
System message denoting a user nitro boosted a guild to level 2.
GuildBoostTier3
System message denoting a user nitro boosted a guild to level 3.
ChannelFollowAdd
System message denoting a channel has been followed.
GuildDiscoveryDisqualified
System message denoting a guild has been disqualified for Server Discovery.
GuildDiscoveryRequalified
System message denoting a guild has been redisqualified for Server Discovery.
GuildDiscoveryGracePeriodInitialWarning
System message denoting an initial warning for Server Discovery disqualification.
GuildDiscoveryGracePeriodFinalWarning
System message denoting a final warning for Server Discovery disqualification.
ThreadCreated
Reply
Message is an inline reply.
ChatInputCommand
Message is a chat input command.
ThreadStarterMessage
GuildInviteReminder
ContextMenuCommand
AutoModerationAction
Message is an auto moderation action.
RoleSubscriptionPurchase
System message denoting a user subscribed to a role.
InteractionPremiumUpsell
System message denoting a interaction premium upsell.
StageStart
System message denoting a stage instance has started.
StageEnd
System message denoting a stage instance has ended.
StageSpeaker
System message for stage instance speakers.
StageTopic
System message denoting the topic for a stage instance.
GuildApplicationPremiumSubscription
System message denoting a guild application premium subscription.
GuildIncidentAlertModeEnabled
System message denoting a guild auto moderation incident alerts are enabled.
GuildIncidentAlertModeDisabled
System message denoting a guild auto moderation incident alerts are disabled.
GuildIncidentReportRaid
System message denoting a guild raid incident report.
GuildIncidentReportRaidFalseAlarm
System message denoting a false positive guild raid incident report.
Unknown(u8)
Variant value is unknown to the library.
Implementations§
source§impl MessageType
impl MessageType
sourcepub const fn deletable(self) -> bool
pub const fn deletable(self) -> bool
Whether the message can be deleted, not taking permissions into account. Some message types can’t be deleted, even by server administrators.
Some message types can only be deleted with certain permissions. For
example, AutoModerationAction
can only
be deleted if the user has the
Manage Messages permission.
To check whether a message can be deleted while taking permissions into
account, use
deletable_with_permissions
.
sourcepub const fn deletable_with_permissions(self, permissions: Permissions) -> bool
pub const fn deletable_with_permissions(self, permissions: Permissions) -> bool
Whether the message can be deleted, taking permissions into account. Some message types can’t be deleted, even by server administrators.
Some message types can only be deleted with certain permissions. For
example, AutoModerationAction
can only
be deleted if the user has the Manage Messages permission.
To check whether a message can be deleted without taking permissions
into account, use deletable
.
Trait Implementations§
source§impl Clone for MessageType
impl Clone for MessageType
source§fn clone(&self) -> MessageType
fn clone(&self) -> MessageType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MessageType
impl Debug for MessageType
source§impl<'de> Deserialize<'de> for MessageType
impl<'de> Deserialize<'de> for MessageType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<MessageType> for u8
impl From<MessageType> for u8
source§fn from(value: MessageType) -> Self
fn from(value: MessageType) -> Self
source§impl From<u8> for MessageType
impl From<u8> for MessageType
source§impl Hash for MessageType
impl Hash for MessageType
source§impl PartialEq for MessageType
impl PartialEq for MessageType
source§impl Serialize for MessageType
impl Serialize for MessageType
impl Copy for MessageType
impl Eq for MessageType
impl StructuralPartialEq for MessageType
Auto Trait Implementations§
impl Freeze for MessageType
impl RefUnwindSafe for MessageType
impl Send for MessageType
impl Sync for MessageType
impl Unpin for MessageType
impl UnwindSafe for MessageType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)