Skip to main content

Module expand

Module expand 

Source
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.

Modules§

discord
Discord message link expansion.
github
GitHub Permalink expansion.

Structs§

ExpandContext
Shared inputs for expanding the links of one message.

Enums§

ExpandError
Errors that can occur during link expansion.
ExpandedContent
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§

LinkExpander
A link expander: parses its own link type out of a message and expands each link into ExpandedContent.

Functions§

parse_links 🔒
Extracts links matching regex from text, applying the shared link policy: URLs wrapped in angle brackets (e.g. <https://...>) are skipped, duplicate URLs are ignored, and at most MAX_LINKS_PER_MESSAGE links are returned.