Expand description
Utility helpers: supported-site URL detection, embed formatting.
Functions§
- extract_
fanfic_ url - Extract the first supported fanfiction URL from a string (message content). Returns the URL as-is (normalized by the caller if needed).
- format_
words - Format a word count compactly: 1234 → “1.2k”, 1500000 → “1.5M”.
- normalize_
url - Normalize a URL to a form FicHub accepts (add scheme if missing).
- truncate
- Truncate a string to
maxchars, appending…when cut.