# luzzy12/fivem-ck-bot architecture

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

- Interactive diagram: https://gitdiagram.com/luzzy12/fivem-ck-bot
- Repository: https://github.com/luzzy12/fivem-ck-bot

## Overview

This is a Discord bot for processing character-kill (CK) requests. In the configured channel, a user submits a Discord ID; the bot looks up the player and presents a confirmation button. Clicking it triggers deletion across player-related tables, followed by an ephemeral result and a channel announcement. The sampled source shows these stages in bot.js and the bot’s configuration in ayarlar.json. No README capabilities beyond support information are documented.

Main entry points: [`bot.js`](https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js) (CK request handler), [`ayarlar.json`](https://github.com/luzzy12/fivem-ck-bot/blob/main/ayarlar.json) (Bot configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord_flow["Discord interaction"]
  node_discord{{"Discord platform"}}
  node_request_handler["CK request handler<br/>[bot.js]"]
  node_confirmation_handler["Button handler<br/>[bot.js]"]
end

subgraph group_ck_processing["CK processing"]
  node_lookup["Player lookup<br/>[bot.js]"]
  node_account_deletion["Account data deletion<br/>[bot.js]"]
end

subgraph group_persistence["Configuration and data"]
  node_config["Bot configuration<br/>[ayarlar.json]"]
  node_mysql[("MySQL database")]
end

node_user(("User"))

node_user -->|"submits ID"| node_discord
node_discord -->|"delivers message"| node_request_handler
node_request_handler -->|"checks ID"| node_lookup
node_lookup -->|"queries player"| node_mysql
node_request_handler -->|"sends confirmation"| node_discord
node_user -->|"clicks button"| node_discord
node_discord -->|"delivers interaction"| node_confirmation_handler
node_confirmation_handler -->|"deletes records"| node_mysql
node_confirmation_handler -->|"sends result and notice"| node_discord
node_config -->|"provides channel ID"| node_request_handler
node_config -->|"provides bot token"| node_confirmation_handler

click node_request_handler "https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js"
click node_confirmation_handler "https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js"
click node_lookup "https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js"
click node_account_deletion "https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js"
click node_config "https://github.com/luzzy12/fivem-ck-bot/blob/main/ayarlar.json"

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_discord,node_request_handler,node_confirmation_handler,node_user toneBlue
class node_lookup,node_account_deletion toneAmber
class node_config,node_mysql toneMint
```

## Components

### Discord interaction

- **Discord platform**
- [CK request handler](https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js): `bot.js`
- [Button handler](https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js): `bot.js`

### CK processing

- [Player lookup](https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js): `bot.js`
- [Account data deletion](https://github.com/luzzy12/fivem-ck-bot/blob/main/bot.js): `bot.js`

### Configuration and data

- [Bot configuration](https://github.com/luzzy12/fivem-ck-bot/blob/main/ayarlar.json): `ayarlar.json`
- **MySQL database**

### Other components

- **User**

## Connections

- User → Discord platform: submits ID
- Discord platform → CK request handler: delivers message (evidence: `bot.js`)
- CK request handler → Player lookup: checks ID (evidence: `bot.js`)
- Player lookup → MySQL database: queries player (evidence: `bot.js`)
- CK request handler → Discord platform: sends confirmation (evidence: `bot.js`)
- User → Discord platform: clicks button
- Discord platform → Button handler: delivers interaction (evidence: `bot.js`)
- Button handler → MySQL database: deletes records (evidence: `bot.js`)
- Button handler → Discord platform: sends result and notice (evidence: `bot.js`)
- Bot configuration → CK request handler: provides channel ID (evidence: `bot.js`)
- Bot configuration → Button handler: provides bot token (evidence: `bot.js`)
