twilight_model::channel::message

Enum MessageType

source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

source

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.

source

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

source§

fn clone(&self) -> MessageType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for MessageType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<MessageType> for u8

source§

fn from(value: MessageType) -> Self

Converts to this type from the input type.
source§

impl From<u8> for MessageType

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for MessageType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for MessageType

source§

fn eq(&self, other: &MessageType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for MessageType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for MessageType

source§

impl Eq for MessageType

source§

impl StructuralPartialEq for MessageType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,