pub struct CachedMessage { /* private fields */ }
Expand description

Represents a cached Message.

Implementations§

source§

impl CachedMessage

source

pub const fn activity(&self) -> Option<&MessageActivity>

For rich presence chat embeds, the activity object.

source

pub const fn application(&self) -> Option<&MessageApplication>

For interaction responses, the ID of the interaction’s application.

source

pub const fn application_id(&self) -> Option<Id<ApplicationMarker>>

Associated application’s ID.

Sent if the message is a response to an Interaction.

source

pub fn attachments(&self) -> &[Attachment]

List of attached files.

Refer to the documentation for Message::attachments for caveats with receiving the attachments of messages.

source

pub const fn author(&self) -> Id<UserMarker>

ID of the message author.

If the author is a webhook, this is its ID.

source

pub const fn channel_id(&self) -> Id<ChannelMarker>

ID of the channel the message was sent in.

source

pub fn components(&self) -> &[Component]

List of provided components, such as buttons.

Refer to the documentation for Message::components for caveats with receiving the components of messages.

source

pub fn content(&self) -> &str

Content of a message.

Refer to the documentation for Message::content for caveats with receiving the content of messages.

source

pub const fn edited_timestamp(&self) -> Option<Timestamp>

Timestamp of the date the message was last edited.

source

pub fn embeds(&self) -> &[Embed]

List of embeds.

Refer to the documentation for Message::embeds for caveats with receiving the embeds of messages.

source

pub const fn flags(&self) -> Option<MessageFlags>

Message flags.

source

pub const fn guild_id(&self) -> Option<Id<GuildMarker>>

ID of the guild the message was sent in, if there is one.

source

pub const fn id(&self) -> Id<MessageMarker>

ID of the message.

source

pub const fn interaction(&self) -> Option<&CachedMessageInteraction>

Information about the message interaction.

source

pub const fn kind(&self) -> MessageType

Type of the message.

source

pub const fn member(&self) -> Option<&PartialMember>

Member data for the author, if there is any.

source

pub fn mention_channels(&self) -> &[ChannelMention]

Channels mentioned in the content.

source

pub const fn mention_everyone(&self) -> bool

Whether or not ‘@everyone’ or ‘@here’ is mentioned in the content.

source

pub fn mention_roles(&self) -> &[Id<RoleMarker>]

Roles mentioned in the content.

source

pub fn mentions(&self) -> &[Id<UserMarker>]

Users mentioned in the content.

source

pub const fn pinned(&self) -> bool

Whether or not the message is pinned.

source

pub fn reactions(&self) -> &[Reaction]

Reactions to the message.

source

pub const fn reference(&self) -> Option<&MessageReference>

Message reference.

source

pub const fn role_subscription_data(&self) -> Option<&RoleSubscriptionData>

Information about the role subscription purchase or renewal that prompted this message.

source

pub fn sticker_items(&self) -> &[MessageSticker]

Stickers within the message.

source

pub const fn thread_id(&self) -> Option<Id<ChannelMarker>>

ID of the thread the message was sent in.

source

pub const fn timestamp(&self) -> Timestamp

Timestamp of the date the message was sent.

source

pub const fn tts(&self) -> bool

Whether the message is text-to-speech.

source

pub const fn webhook_id(&self) -> Option<Id<WebhookMarker>>

For messages sent by webhooks, the webhook ID.

Trait Implementations§

source§

impl Clone for CachedMessage

source§

fn clone(&self) -> CachedMessage

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 CachedMessage

source§

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

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

impl From<Message> for CachedMessage

source§

fn from(message: Message) -> Self

Converts to this type from the input type.
source§

impl PartialEq<CachedMessage> for CachedMessage

source§

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

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

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

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

impl Serialize for CachedMessage

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 StructuralPartialEq for CachedMessage

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.