# drakocodex/discordbot architecture

> Architecture diagram of the GitHub repository drakocodex/discordbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drakocodex/discordbot
- Repository: https://github.com/drakocodex/discordbot

## Overview

DrakoStore Bot is a Discord storefront/community bot. Its principal workflow is a user opening a free-trial ticket, submitting proof, staff approving it, and the bot delivering a key by DM. The README documents server setup, live game status, moderation, welcome messages, and persistent voice presence; the sampled `index.js` shows the runtime entry point and parts of these handlers. Several capabilities are documented but their implementation details were not sampled, so those relationships rely on the README.

Main entry points: [`index.js`](https://github.com/drakocodex/discordbot/blob/main/index.js) (Bot event handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server experience"]
  node_setup["Server setup<br/>[index.js]"]
  node_status["Live game status<br/>[index.js]"]
  node_voice["Support voice presence<br/>[index.js]"]
end

subgraph group_trials["Trial fulfillment"]
  node_ticket["Trial ticket creation<br/>[index.js]"]
  node_proof["Proof submission review<br/>[index.js]"]
  node_approval["Staff approval<br/>[index.js]"]
  node_keystock[("Game key stock<br/>[index.js]")]
  node_keydelivery["Key DM delivery<br/>[index.js]"]
end

subgraph group_safety["Community safety"]
  node_welcome["Welcome messages<br/>[index.js]"]
  node_automod["Link and spam moderation<br/>[index.js]"]
end

subgraph group_runtime["Bot runtime"]
  node_bot["Bot event handlers<br/>[index.js]"]
  node_keepalive["Keep-alive HTTP<br/>[index.js]"]
end

node_member(("Discord member"))
node_staff(("Reviewing staff"))
node_discord["Discord platform"]
node_uptimerobot(("UptimeRobot"))

node_member -->|"uses commands"| node_bot
node_bot -->|"runs setup"| node_setup
node_setup -->|"creates channels"| node_discord
node_setup -->|"publishes status"| node_status
node_bot -->|"maintains presence"| node_voice
node_bot -->|"welcomes members"| node_welcome
node_bot -->|"moderates messages"| node_automod
node_member -->|"opens ticket"| node_ticket
node_ticket -->|"creates channel"| node_discord
node_member -->|"submits capture"| node_proof
node_proof -->|"sends for review"| node_staff
node_staff -->|"approves capture"| node_approval
node_approval -->|"claims key"| node_keystock
node_approval -->|"sends key"| node_keydelivery
node_keydelivery -->|"delivers by DM"| node_member
node_keepalive -->|"serves probes"| node_uptimerobot
node_keepalive -.->|"runs alongside"| node_discord

click node_bot "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_keepalive "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_setup "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_status "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_voice "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_welcome "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_automod "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_ticket "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_proof "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_approval "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_keystock "https://github.com/drakocodex/discordbot/blob/main/index.js"
click node_keydelivery "https://github.com/drakocodex/discordbot/blob/main/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_setup,node_status,node_voice,node_staff toneBlue
class node_ticket,node_proof,node_approval,node_keystock,node_keydelivery toneAmber
class node_welcome,node_automod toneMint
class node_bot,node_keepalive toneRose
class node_member,node_discord,node_uptimerobot toneIndigo
```

## Components

### Server experience

- [Server setup](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Live game status](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Support voice presence](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`

### Trial fulfillment

- [Trial ticket creation](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Proof submission review](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Staff approval](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Game key stock](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Key DM delivery](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`

### Community safety

- [Welcome messages](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Link and spam moderation](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`

### Bot runtime

- [Bot event handlers](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`
- [Keep-alive HTTP](https://github.com/drakocodex/discordbot/blob/main/index.js): `index.js`

### Other components

- **Discord member**
- **Reviewing staff**
- **Discord platform**
- **UptimeRobot**

## Connections

- Discord member → Bot event handlers: uses commands (evidence: `README.md`)
- Bot event handlers → Server setup: runs setup (evidence: `README.md`)
- Server setup → Discord platform: creates channels (evidence: `README.md`)
- Server setup → Live game status: publishes status (evidence: `index.js`)
- Bot event handlers → Support voice presence: maintains presence (evidence: `index.js`)
- Bot event handlers → Welcome messages: welcomes members (evidence: `README.md`)
- Bot event handlers → Link and spam moderation: moderates messages (evidence: `index.js`)
- Discord member → Trial ticket creation: opens ticket (evidence: `README.md`)
- Trial ticket creation → Discord platform: creates channel (evidence: `index.js`)
- Discord member → Proof submission review: submits capture (evidence: `README.md`)
- Proof submission review → Reviewing staff: sends for review (evidence: `README.md`)
- Reviewing staff → Staff approval: approves capture (evidence: `README.md`)
- Staff approval → Game key stock: claims key (evidence: `index.js`)
- Staff approval → Key DM delivery: sends key (evidence: `README.md`)
- Key DM delivery → Discord member: delivers by DM (evidence: `README.md`)
- Keep-alive HTTP → UptimeRobot: serves probes (evidence: `README.md`)
- Keep-alive HTTP → Discord platform: runs alongside
