Struct MessageUpdateEvent

Source
#[non_exhaustive]
pub struct MessageUpdateEvent {
Show 32 fields pub id: MessageId, pub channel_id: ChannelId, pub author: Option<User>, pub content: Option<String>, pub timestamp: Option<Timestamp>, pub edited_timestamp: Option<Timestamp>, pub tts: Option<bool>, pub mention_everyone: Option<bool>, pub mentions: Option<Vec<User>>, pub mention_roles: Option<Vec<RoleId>>, pub mention_channels: Option<Vec<ChannelMention>>, pub attachments: Option<Vec<Attachment>>, pub embeds: Option<Vec<Embed>>, pub reactions: Option<Vec<MessageReaction>>, pub pinned: Option<bool>, pub webhook_id: Option<Option<WebhookId>>, pub kind: Option<MessageType>, pub activity: Option<Option<MessageActivity>>, pub application: Option<Option<MessageApplication>>, pub application_id: Option<Option<ApplicationId>>, pub message_reference: Option<Option<MessageReference>>, pub flags: Option<Option<MessageFlags>>, pub referenced_message: Option<Option<Box<Message>>>, pub interaction: Option<Option<Box<MessageInteraction>>>, pub interaction_metadata: Option<Option<Box<MessageInteractionMetadata>>>, pub thread: Option<Option<GuildChannel>>, pub components: Option<Vec<ActionRow>>, pub sticker_items: Option<Vec<StickerItem>>, pub position: Option<Option<u64>>, pub role_subscription_data: Option<Option<RoleSubscriptionData>>, pub guild_id: Option<GuildId>, pub member: Option<Option<Box<PartialMember>>>,
}
Expand description

Requires GatewayIntents::GUILD_MESSAGES.

Contains identical fields to Message, except everything but id and channel_id are optional. Even fields that cannot change in a message update event are included, because Discord may include them anyways, independent from whether they have actually changed (like Self::guild_id)

Discord docs.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: MessageId§channel_id: ChannelId§author: Option<User>§content: Option<String>§timestamp: Option<Timestamp>§edited_timestamp: Option<Timestamp>§tts: Option<bool>§mention_everyone: Option<bool>§mentions: Option<Vec<User>>§mention_roles: Option<Vec<RoleId>>§mention_channels: Option<Vec<ChannelMention>>§attachments: Option<Vec<Attachment>>§embeds: Option<Vec<Embed>>§reactions: Option<Vec<MessageReaction>>§pinned: Option<bool>§webhook_id: Option<Option<WebhookId>>§kind: Option<MessageType>§activity: Option<Option<MessageActivity>>§application: Option<Option<MessageApplication>>§application_id: Option<Option<ApplicationId>>§message_reference: Option<Option<MessageReference>>§flags: Option<Option<MessageFlags>>§referenced_message: Option<Option<Box<Message>>>§interaction: Option<Option<Box<MessageInteraction>>>
👎Deprecated: Use interaction_metadata
§interaction_metadata: Option<Option<Box<MessageInteractionMetadata>>>§thread: Option<Option<GuildChannel>>§components: Option<Vec<ActionRow>>§sticker_items: Option<Vec<StickerItem>>§position: Option<Option<u64>>§role_subscription_data: Option<Option<RoleSubscriptionData>>§guild_id: Option<GuildId>§member: Option<Option<Box<PartialMember>>>

Implementations§

Source§

impl MessageUpdateEvent

Source

pub fn apply_to_message(&self, message: &mut Message)

Writes the updated data in this message update event into the given Message.

Trait Implementations§

Source§

impl CacheUpdate for MessageUpdateEvent

Available on crate feature cache only.
Source§

type Output = Message

The return type of an update. Read more
Source§

fn update(&mut self, cache: &Cache) -> Option<Self::Output>

Updates the cache with the implementation.
Source§

impl Clone for MessageUpdateEvent

Source§

fn clone(&self) -> MessageUpdateEvent

Returns a duplicate 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 MessageUpdateEvent

Source§

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

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

impl<'de> Deserialize<'de> for MessageUpdateEvent

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 Serialize for MessageUpdateEvent

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

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> CloneDebuggableStorage for T

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> CloneableStorage for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DebuggableStorage for T
where T: Any + Send + Sync + Debug,

Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,