#[non_exhaustive]
pub struct MessageUpdateEvent {
Show 31 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 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>>>§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.
§

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 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 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> 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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

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>,