Expand description
Link expansion module.
This module provides common types for expanding various types of links (Discord message links, GitHub permalinks, etc.) into rich preview content.
Re-exportsยง
use crate::config::BabyriteConfig;๐use crate::context::BotContext;๐use regex::Regex;๐use std::collections::HashSet;๐use twilight_model::channel::Message;๐use twilight_model::channel::message::Embed;๐use twilight_model::id::Id;๐use twilight_model::id::marker::GuildMarker;๐
Modulesยง
Structsยง
- Expand
Context - Shared inputs for expanding the links of one message.
Enumsยง
- Expand
Error - Errors that can occur during link expansion.
- Expanded
Content - Expanded content produced by a link expander.
Constantsยง
- MAX_
LINKS_ ๐PER_ MESSAGE - Maximum number of links expanded per message.
Staticsยง
- EXPANDERS
- All registered link expanders, in the order their results appear in a reply.
Traitsยง
- Link
Expander - A link expander: parses its own link type out of a message and expands
each link into
ExpandedContent.
Functionsยง
- parse_
links ๐ - Extracts links matching
regexfromtext, applying the shared link policy: URLs wrapped in angle brackets (e.g.<https://...>) are skipped, duplicate URLs are ignored, and at mostMAX_LINKS_PER_MESSAGElinks are returned.