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ยง
- Discord
Expander - Discord message link expander.
- Message
LinkI Ds - Parsed IDs from a Discord message link.
- Preview
- A preview containing the message and its channel.
Enumsยง
- Preview
Error - 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_channelcould also viewchannel. - has_
member_ ๐view_ allow - Returns
trueif any per-member overwrite grantsVIEW_CHANNEL. - has_
member_ ๐view_ deny - Returns
trueif any per-member overwrite deniesVIEW_CHANNEL. - is_
cross_ ๐guild - Returns
truewhen a link crosses a guild boundary. - is_
thread ๐ - Returns
truefor thread channel types. - member_
granted_ ๐source_ is_ safe - Returns
truewhen a source channel that grants access through per-member overwrites may still be expanded into the target described bydest_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
truewhen the linkโs visibility must be validated against the requestโs source channel. - viewing_
roles ๐ - Computes the set of roles that can effectively
VIEW_CHANNELa channel.