How anshm42/slangify works
Slangify is a Discord bot that defines slang in a referenced message. Users trigger it either by mentioning the bot in a reply or by selecting a message context-menu command; the bot obtains the target text, chooses a lookup source, and returns definitions as a Discord embed. Lookup has three modes: Gemini definitions, Urban Dictionary token lookups, and a hybrid that uses Gemini to identify terms before querying Urban. The graph reflects sampled runtime code and README-documented interaction modes.
Main entry points: bot.py Bot handlers · hybrid.py Hybrid lookup · gemini.py Gemini lookup · urban.py Urban lookup
Components 10
Discord Interaction
- Bot handlers
src/slangify/bot.py - Mention parser
src/slangify/trigger.py
Definition Lookup
- Hybrid lookup
src/slangify/sources/hybrid.py - Gemini lookup
src/slangify/sources/gemini.py - Urban lookup
src/slangify/sources/urban.py
Response
- Embed builder
src/slangify/format.py
Other components
- Discord user
- Discord platform
- Gemini API
- Urban Dictionary API
Connections 14
- Discord user → Discord platform: submits message
- Discord platform → Bot handlers: dispatches events
- Bot handlers → Discord platform: fetches replied message
- Bot handlers → Mention parser: parses mention
- Bot handlers → Hybrid lookup: selects source
- Bot handlers → Gemini lookup: selects source
- Bot handlers → Urban lookup: selects source
- Hybrid lookup → Gemini lookup: extracts terms
- Hybrid lookup → Urban lookup: fetches definitions
- Gemini lookup → Gemini API: requests generation
- Urban lookup → Urban Dictionary API: queries terms
- Bot handlers → Embed builder: builds embed
- Bot handlers → Discord platform: sends response
- Discord platform → Discord user: delivers response