How yourpovv/mizu works
Mizu is a serverless Discord community bot. Discord sends slash-command, modal, and component interactions to one HTTP endpoint; the endpoint verifies and dispatches them, then returns responses or invokes Discord’s REST API. Its main workflows provide credits, color-role selection, game-ping management, and a custom embed preview with keep/delete confirmation. Role pickers read and update member roles; embed handling builds and posts previews. The graph follows the excerpts and README; connections for sampled modules are supported by the source index where noted, while unsampled command definitions are grouped without speculative runtime links.
Main entry points: interactions.ts Interaction endpoint · discord-rest.ts Discord REST client · color-select.ts Color role handler · game-select.ts Game role handler
Components 14
Interaction ingress
- Interaction endpoint
api/interactions.ts - Slash command definitions
src/commands - Credits response
src/lib/credits.ts
Role pickers
- Color picker data
src/lib/colors.ts - Color role handler
src/lib/color-select.ts - Game picker data
src/lib/games.ts - Game role handler
src/lib/game-select.ts
Embed builder
- Embed workflow
src/lib/embed-flow.ts - Embed construction
src/lib/embeds.ts
Shared services
- Discord configuration
src/config.ts - Environment access
src/lib/env.ts - Discord REST client
src/lib/discord-rest.ts
Other components
- Discord interactions
- Discord API
Connections 16
- Discord interactions → Interaction endpoint: sends interactions
README.md - Interaction endpoint → Discord configuration: loads key
api/interactions.ts - Discord configuration → Environment access: requires variable
src/config.ts - Interaction endpoint → Credits response: builds response
api/interactions.ts - Interaction endpoint → Color picker data: builds picker
api/interactions.ts - Interaction endpoint → Color role handler: dispatches selection
api/interactions.ts - Color role handler → Color picker data: uses role data
src/lib/color-select.ts - Color role handler → Discord REST client: updates roles
src/lib/color-select.ts - Interaction endpoint → Game picker data: builds picker
api/interactions.ts - Interaction endpoint → Game role handler: dispatches selection
api/interactions.ts - Game role handler → Game picker data: plans role sync
src/lib/game-select.ts - Game role handler → Discord REST client: reads and updates roles
src/lib/game-select.ts - Interaction endpoint → Embed workflow: dispatches embed actions
api/interactions.ts - Embed workflow → Embed construction: builds modal and preview
src/lib/embed-flow.ts - Embed workflow → Discord REST client: posts or deletes preview
src/lib/embed-flow.ts - Discord REST client → Discord API: makes REST requests
src/lib/discord-rest.ts