Skip to main content

Module discord

Module discord 

Source
Expand description

Discord message link expansion.

This module provides functionality for parsing Discord message links and generating embed previews of the linked messages.

Migrated from preview.rs with support for multiple link expansion.

Structsยง

DiscordExpander
Discord message link expander.
MessageLinkIDs
Parsed IDs from a Discord message link.
Preview
A preview containing the message and its channel.

Enumsยง

PreviewError
Errors that can occur when generating a Discord message preview.

Constantsยง

PREVIEW_EMBED_COLOUR ๐Ÿ”’
Accent colour of a message preview embed.

Staticsยง

MESSAGE_LINK_REGEX
Regex pattern for matching Discord message links.

Functionsยง

check_visibility ๐Ÿ”’
Validates that everyone who can view source_channel could also view channel.
has_member_view_allow ๐Ÿ”’
Returns true if any per-member overwrite grants VIEW_CHANNEL.
has_member_view_deny ๐Ÿ”’
Returns true if any per-member overwrite denies VIEW_CHANNEL.
is_cross_guild ๐Ÿ”’
Returns true when a link crosses a guild boundary.
is_thread ๐Ÿ”’
Returns true for thread channel types.
member_granted_source_is_safe ๐Ÿ”’
Returns true when a source channel that grants access through per-member overwrites may still be expanded into the target described by dest_roles.
permission_channel ๐Ÿ”’
Resolves the channel that carries the properties a thread inherits โ€” its permission overwrites and its NSFW flag.
preview_embed ๐Ÿ”’
Renders a fetched message as the embed posted in the requesterโ€™s channel.
requires_visibility_check ๐Ÿ”’
Returns true when the linkโ€™s visibility must be validated against the requestโ€™s source channel.
viewing_roles ๐Ÿ”’
Computes the set of roles that can effectively VIEW_CHANNEL a channel.