Struct twilight_cache_inmemory::model::message::CachedMessage
source · 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 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 moresource§impl Debug for CachedMessage
impl Debug for CachedMessage
source§impl From<Message> for CachedMessage
impl From<Message> for CachedMessage
source§impl PartialEq<CachedMessage> for CachedMessage
impl PartialEq<CachedMessage> for CachedMessage
source§fn eq(&self, other: &CachedMessage) -> bool
fn eq(&self, other: &CachedMessage) -> bool
self
and other
values to be equal, and is used
by ==
.