How tokioshi/reine works
Reine Workers is a serverless Discord interactions bot. Discord users invoke slash commands or interact with message components; the Worker routes and verifies requests, dispatches handlers, and returns Discord responses. Its distinct product branches include community information panels, moderation and message/embed utilities, AniList watchlists with scheduled episode checks, and private-thread tickets with close/reopen management. Shared Discord API and D1 modules support these workflows. Some command and scheduled internals were not excerpted, so those links are included only where the README or source index establishes them.
Main entry points: commands.js Command Registry · tickets.js Ticket Workflow · discord.js Discord Client · interactions.js Interaction Router
Components 28
Worker Runtime
- Worker Entry
index.js - HTTP Routes
events/fetch.js - Scheduled Event
events/scheduled.js
Interaction Dispatch
- Interaction Router
handler/interactions.js - Command Registry
handler/commands.js - Moderation Commands
commands/ban.js - Message Utilities
commands/message.js - Embed Builder
commands/embed.js
Community Features
- Info Panels
components/faq.js - Payment Panel
components/payment-method.js - Price Panels
components/bot-price-list.js - Server Price Panel
components/server-price-list.js
Anime Tracking
- Watch Commands
commands/watch.js - Watchlist Commands
commands/list.js - Watchlist Store
utils/database.js - Episode Checker
utils/episode-checker.js - AniList Client
utils/anilist.js - Episode Notifier
utils/notify.js
Ticket System
- Ticket Panel Command
commands/ticket-panel.js - Ticket Workflow
utils/tickets.js - Ticket Store
utils/ticket-database.js
Shared Services
- Discord API
- Discord Client
utils/discord.js - Response Helpers
utils/responses.js - Request Verification
utils/verify.js - Cloudflare D1
Other components
- Discord Users
- AniList Service
Connections 36
- Discord Users → HTTP Routes: sends requests
README.md - Worker Entry → HTTP Routes: forwards HTTP
index.js - Worker Entry → Scheduled Event: forwards schedules
index.js - HTTP Routes → Interaction Router: routes interactions
events/fetch.js - HTTP Routes → Command Registry: routes registration
events/fetch.js - Interaction Router → Request Verification: verifies requests
handler/interactions.js - Interaction Router → Command Registry: dispatches interactions
handler/interactions.js - Command Registry → Moderation Commands: registers commands
handler/commands.js - Command Registry → Message Utilities: registers commands
handler/commands.js - Command Registry → Embed Builder: registers commands
handler/commands.js - Command Registry → Watch Commands: registers commands
handler/commands.js - Command Registry → Watchlist Commands: registers commands
handler/commands.js - Command Registry → Info Panels: registers handlers
handler/commands.js - Command Registry → Payment Panel: registers handlers
handler/commands.js - Command Registry → Price Panels: registers handlers
handler/commands.js - Command Registry → Server Price Panel: registers handlers
handler/commands.js - Command Registry → Ticket Panel Command: registers commands
handler/commands.js - Watch Commands → AniList Client: looks up anime
commands/watch.js - Watch Commands → Watchlist Store: updates watchlist
commands/watch.js - Watchlist Commands → Watchlist Store: reads watchlist
commands/list.js - Scheduled Event → Episode Checker: starts checks
events/scheduled.js - Episode Checker → Watchlist Store: reads and updates
utils/episode-checker.js - Episode Checker → AniList Client: checks releases
utils/episode-checker.js - Episode Checker → Episode Notifier: notifies episodes
utils/episode-checker.js - AniList Client → AniList Service: requests metadata
- Ticket Panel Command → Ticket Workflow: starts ticket flow
commands/ticket-panel.js - Interaction Router → Ticket Workflow: dispatches ticket actions
- Scheduled Event → Ticket Workflow: runs ticket tasks
events/scheduled.js - Ticket Workflow → Ticket Store: manages ticket state
utils/tickets.js - Watchlist Store → Cloudflare D1: queries D1
- Ticket Store → Cloudflare D1: queries D1
- Moderation Commands → Discord Client: performs moderation
commands/ban.js - Message Utilities → Discord Client: manages messages
commands/message.js - Embed Builder → Discord Client: sends and edits
commands/embed.js - Ticket Workflow → Discord Client: manages threads
utils/tickets.js - Discord Client → Discord API: calls API
utils/discord.js