How baizhi2503/cafe--standalone- works
This is a standalone Discord cafe-ordering bot. A staff member opens a cafe session for a customer; the customer browses the menu or builds a custom drink, adds items, checks out, selects dine-in or takeaway and a tip, then receives a preparation estimate and completed-order delivery. The map preserves menu presentation, order/session handling, custom-drink composition, and delivery/logging. Source excerpts support the principal calls; menu JSON structure and some interaction branches are not shown, so no extra links are inferred for them.
Main entry points: interaction_handler.js Button handling · cafeindex.js Cafe command · cafe_utils.js Delivery and logging · embed_builder.js Order presentation
Components 19
Discord entry
- Cafe command
cafeindex.js - Active orders
cafeindex.js - Interaction router
cafeindex.js
Ordering experience
- Button handling
interaction_handler.js - Modal handling
interaction_handler.js - Menu browsing
menu_logic.js - Menu catalog
menu.json - Custom drink builder
interaction_handler.js - Drink naming
cafe_utils.js - Order presentation
embed_builder.js - Order controls
embed_builder.js
Order fulfillment
- Preparation estimate
cafe_utils.js - Delivery and logging
cafe_utils.js
Other components
- Cafe staff
- Customer
- Discord API
- Dine-in channel
- Customer DM
- Cafe log channel
Connections 25
- Cafe staff → Discord API: invokes command
- Discord API → Cafe command: routes command
cafeindex.js - Cafe command → Active orders: creates session
cafeindex.js - Cafe command → Order presentation: renders terminal
cafeindex.js - Cafe command → Order controls: adds controls
cafeindex.js - Cafe command → Discord API: replies
cafeindex.js - Customer → Discord API: submits interactions
- Discord API → Interaction router: dispatches events
cafeindex.js - Interaction router → Button handling: routes buttons
cafeindex.js - Interaction router → Modal handling: routes modals
cafeindex.js - Button handling → Active orders: reads and updates
interaction_handler.js - Modal handling → Active orders: reads and updates
interaction_handler.js - Button handling → Menu browsing: requests menu data
interaction_handler.js - Menu browsing → Menu catalog: reads catalog
menu_logic.js - Button handling → Order presentation: renders order
interaction_handler.js - Button handling → Order controls: requests controls
interaction_handler.js - Modal handling → Order presentation: renders updated order
interaction_handler.js - Button handling → Custom drink builder: advances drink steps
interaction_handler.js - Modal handling → Drink naming: constructs drink name
interaction_handler.js - Button handling → Drink naming: constructs drink name
interaction_handler.js - Button handling → Preparation estimate: calculates estimate
interaction_handler.js - Button handling → Delivery and logging: finalizes order
interaction_handler.js - Delivery and logging → Dine-in channel: posts served order
cafe_utils.js - Delivery and logging → Customer DM: sends takeaway
cafe_utils.js - Delivery and logging → Cafe log channel: logs completion
cafe_utils.js