pub struct CachedMessage { /* private fields */ }
Expand description
Represents a cached Message
.
Implementations§
Source§impl CachedMessage
impl CachedMessage
Sourcepub const fn activity(&self) -> Option<&MessageActivity>
pub const fn activity(&self) -> Option<&MessageActivity>
For rich presence chat embeds, the activity object.
Sourcepub const fn application(&self) -> Option<&MessageApplication>
pub const fn application(&self) -> Option<&MessageApplication>
For interaction responses, the ID of the interaction’s application.
Sourcepub const fn application_id(&self) -> Option<Id<ApplicationMarker>>
pub const fn application_id(&self) -> Option<Id<ApplicationMarker>>
Associated application’s ID.
Sent if the message is a response to an Interaction.
Sourcepub fn attachments(&self) -> &[Attachment]
pub fn attachments(&self) -> &[Attachment]
List of attached files.
Refer to the documentation for Message::attachments
for caveats with
receiving the attachments of messages.
ID of the message author.
If the author is a webhook, this is its ID.
Sourcepub const fn channel_id(&self) -> Id<ChannelMarker>
pub const fn channel_id(&self) -> Id<ChannelMarker>
ID of the channel the message was sent in.
Sourcepub fn components(&self) -> &[Component]
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.
Sourcepub fn content(&self) -> &str
pub fn content(&self) -> &str
Content of a message.
Refer to the documentation for Message::content
for caveats with
receiving the content of messages.
Sourcepub const fn edited_timestamp(&self) -> Option<Timestamp>
pub const fn edited_timestamp(&self) -> Option<Timestamp>
Timestamp
of the date the message was last edited.
Sourcepub fn embeds(&self) -> &[Embed]
pub fn embeds(&self) -> &[Embed]
List of embeds.
Refer to the documentation for Message::embeds
for caveats with
receiving the embeds of messages.
Sourcepub const fn flags(&self) -> Option<MessageFlags>
pub const fn flags(&self) -> Option<MessageFlags>
Message flags.
Sourcepub const fn guild_id(&self) -> Option<Id<GuildMarker>>
pub const fn guild_id(&self) -> Option<Id<GuildMarker>>
ID of the guild the message was sent in, if there is one.
Sourcepub const fn id(&self) -> Id<MessageMarker>
pub const fn id(&self) -> Id<MessageMarker>
ID of the message.
Sourcepub const fn interaction(&self) -> Option<&CachedMessageInteraction>
pub const fn interaction(&self) -> Option<&CachedMessageInteraction>
Information about the message interaction.
Sourcepub const fn kind(&self) -> MessageType
pub const fn kind(&self) -> MessageType
Type of the message.
Sourcepub const fn member(&self) -> Option<&PartialMember>
pub const fn member(&self) -> Option<&PartialMember>
Member data for the author, if there is any.
Sourcepub fn mention_channels(&self) -> &[ChannelMention]
pub fn mention_channels(&self) -> &[ChannelMention]
Channels mentioned in the content.
Sourcepub const fn mention_everyone(&self) -> bool
pub const fn mention_everyone(&self) -> bool
Whether or not ‘@everyone’ or ‘@here’ is mentioned in the content.
Sourcepub fn mention_roles(&self) -> &[Id<RoleMarker>]
pub fn mention_roles(&self) -> &[Id<RoleMarker>]
Roles mentioned in the content.
Sourcepub fn mentions(&self) -> &[Id<UserMarker>]
pub fn mentions(&self) -> &[Id<UserMarker>]
Users mentioned in the content.
Sourcepub const fn reference(&self) -> Option<&MessageReference>
pub const fn reference(&self) -> Option<&MessageReference>
Message reference.
Sourcepub const fn role_subscription_data(&self) -> Option<&RoleSubscriptionData>
pub const fn role_subscription_data(&self) -> Option<&RoleSubscriptionData>
Information about the role subscription purchase or renewal that prompted this message.
Sourcepub fn sticker_items(&self) -> &[MessageSticker]
pub fn sticker_items(&self) -> &[MessageSticker]
Stickers within the message.
Sourcepub const fn thread_id(&self) -> Option<Id<ChannelMarker>>
pub const fn thread_id(&self) -> Option<Id<ChannelMarker>>
ID of the thread the message was sent in.
Sourcepub const fn webhook_id(&self) -> Option<Id<WebhookMarker>>
pub const fn webhook_id(&self) -> Option<Id<WebhookMarker>>
For messages sent by webhooks, the webhook ID.
Trait Implementations§
Source§impl CacheableMessage for CachedMessage
impl CacheableMessage for CachedMessage
Source§fn reactions_mut(&mut self) -> &mut [Reaction]
fn reactions_mut(&mut self) -> &mut [Reaction]
Source§fn retain_reactions(&mut self, f: impl FnMut(&Reaction) -> bool)
fn retain_reactions(&mut self, f: impl FnMut(&Reaction) -> bool)
Source§fn clear_reactions(&mut self)
fn clear_reactions(&mut self)
Source§fn add_reaction(&mut self, reaction: Reaction)
fn add_reaction(&mut self, reaction: Reaction)
Source§fn remove_reaction(&mut self, idx: usize)
fn remove_reaction(&mut self, idx: usize)
Source§impl Clone for CachedMessage
impl Clone for CachedMessage
Source§fn clone(&self) -> CachedMessage
fn clone(&self) -> CachedMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more