pub struct MessageLinkIDs {
pub guild_id: GuildId,
pub channel_id: ChannelId,
pub message_id: MessageId,
}Expand description
Parsed IDs from a Discord message link.
Fields§
§guild_id: GuildIdThe guild ID from the message link.
channel_id: ChannelIdThe channel ID from the message link.
message_id: MessageIdThe message ID from the message link.
Implementations§
Source§impl MessageLinkIDs
impl MessageLinkIDs
Sourcepub fn parse_all(text: &str) -> Vec<MessageLinkIDs>
pub fn parse_all(text: &str) -> Vec<MessageLinkIDs>
Parses all Discord message links from the given text.
Returns a Vec<MessageLinkIDs> containing all valid message links found.
The shared link policy applies (see super::parse_links): angle-bracket
wrapped and duplicate URLs are ignored, and at most 3 links are returned.
Sourcepub async fn fetch(
&self,
ctx: &Context,
source_channel: &GuildChannel,
) -> Result<ExpandedContent, ExpandError>
pub async fn fetch( &self, ctx: &Context, source_channel: &GuildChannel, ) -> Result<ExpandedContent, ExpandError>
Fetches the linked message and returns an embed preview.
source_channel is the channel where the request originated. It is used to
ensure the linked content is not exposed to members who could not otherwise
view it (see Preview::get).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessageLinkIDs
impl RefUnwindSafe for MessageLinkIDs
impl Send for MessageLinkIDs
impl Sync for MessageLinkIDs
impl Unpin for MessageLinkIDs
impl UnsafeUnpin for MessageLinkIDs
impl UnwindSafe for MessageLinkIDs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more