How eitaar/mipc works
This is a Discord bot for browsing and maintaining item price listings. Users invoke slash commands; the interaction handler dispatches them to command modules, which query or mutate PostgreSQL data and return replies, often formatted as embeds. Administrators have commands for managing item tables and listings, while users can view prices, lists, help, and ping. Startup also registers and loads commands, and the bot exposes a small HTTP health response. Several command implementations were not excerpted, so their detailed database and reply flows are shown only where supported or marked unverified.
Main entry points: interaction_create_handler.js Interaction dispatch · db.js Listing queries · index.js Bot startup · bp.js Best price
Components 21
Bot runtime
- Bot startup
index.js - Health response
index.js - Interaction dispatch
other/interaction_create_handler.js - Command loading
other/load_commands.js - Command registration
other/deploy-commands.js - Test message
index.js
Discord commands
- Best price
commands/db/bp.js - Add listing
commands/db/adddata.js - Delete listing
commands/db/deldata.js - Create item
commands/db/newitem.js - Drop item
commands/db/delitem.js - Item catalog
commands/db/itemlist.js - Listing list
commands/db/list.js - Help command
commands/general/help.js - Ping command
commands/general/ping.js
Listing data
- Listing queries
db.js
Reply formatting
- Embed builders
embeds.js
Other components
- Discord user
- Discord API
- PostgreSQL
- Health client
Connections 31
- Discord user → Discord API: invokes commands
- Discord API → Interaction dispatch: emits interactions
other/interaction_create_handler.js - Bot startup → Interaction dispatch: registers handler
index.js - Bot startup → Command registration: starts registration
index.js - Bot startup → Command loading: loads on ready
index.js - Interaction dispatch → Best price: dispatches command
- Interaction dispatch → Add listing: dispatches command
- Interaction dispatch → Delete listing: dispatches command
- Interaction dispatch → Create item: dispatches command
- Interaction dispatch → Drop item: dispatches command
- Interaction dispatch → Item catalog: dispatches command
- Interaction dispatch → Listing list: dispatches command
- Interaction dispatch → Help command: dispatches command
- Interaction dispatch → Ping command: dispatches command
- Command loading → Discord API: fills command map
other/load_commands.js - Command registration → Discord API: registers commands
other/deploy-commands.js - Discord user → Best price: requests price
commands/db/bp.js - Best price → Listing queries: queries lowest price
commands/db/bp.js - Add listing → Listing queries: adds listing
commands/db/adddata.js - Delete listing → Listing queries: deletes listing
commands/db/deldata.js - Create item → Listing queries: creates table
commands/db/newitem.js - Drop item → Listing queries: drops table
commands/db/delitem.js - Item catalog → Listing queries: reads item catalog
commands/db/itemlist.js - Listing list → Listing queries: reads listings
commands/db/list.js - Listing queries → PostgreSQL: queries and mutates
db.js - Listing queries → Embed builders: formats results
db.js - Help command → Embed builders: builds help embed
commands/general/help.js - Discord user → Help command: requests help
commands/general/help.js - Bot startup → Test message: handles messages
index.js - Test message → Listing queries: queries best price
index.js - Health client → Health response: requests status
index.js