# exploit1337/discordjs-welcome-bot architecture

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

- Interactive diagram: https://gitdiagram.com/exploit1337/discordjs-welcome-bot
- Repository: https://github.com/exploit1337/discordjs-welcome-bot

## Overview

Welcome Bot is a Discord.js bot that lets administrators choose a server’s welcome channel, then posts a generated welcome image when a member joins. The message handler loads and dispatches commands; the join handler reads the saved channel, renders an image with Jimp, and sends it to Discord. The README documents the command and quick.db storage; sampled source shows the event handlers and rendering details.

Main entry points: [`index.js`](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js) (Event handlers), [`commands/setchannel.js`](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/commands/setchannel.js) (Set channel), [`config.json`](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/config.json) (Bot settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_settings["Bot settings<br/>[config.json]"]
  node_event_handlers["Event handlers<br/>[index.js]"]
  node_command_loader["Command loader<br/>[index.js]"]
  node_command_dispatch["Command dispatch<br/>[index.js]"]
end

subgraph group_welcome["Welcome workflow"]
  node_welcome_lookup["Channel lookup<br/>[index.js]"]
  node_image_rendering["Image rendering<br/>[index.js]"]
  node_image_sources["Image sources"]
  node_welcome_delivery["Welcome delivery<br/>[index.js]"]
end

subgraph group_configuration["Channel setup"]
  node_set_channel["Set channel<br/>[setchannel.js]"]
  node_channel_store[("Channel store<br/>[setchannel.js]")]
end

node_admin(("Administrator"))
node_member(("New member"))
node_discord["Discord"]

node_settings -->|"provides credentials"| node_event_handlers
node_event_handlers -->|"loads commands"| node_command_loader
node_event_handlers -->|"routes messages"| node_command_dispatch
node_admin -->|"sends command"| node_command_dispatch
node_command_dispatch -->|"runs command"| node_set_channel
node_set_channel -->|"saves channel"| node_channel_store
node_set_channel -->|"checks channel"| node_discord
node_member -->|"joins server"| node_event_handlers
node_event_handlers -->|"handles join"| node_welcome_lookup
node_welcome_lookup -->|"fetches channel"| node_channel_store
node_welcome_lookup -->|"starts rendering"| node_image_rendering
node_image_sources -->|"supplies images"| node_image_rendering
node_image_rendering -->|"writes image"| node_welcome_delivery
node_welcome_delivery -->|"sends welcome"| node_discord

click node_settings "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/config.json"
click node_event_handlers "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js"
click node_command_loader "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js"
click node_command_dispatch "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js"
click node_set_channel "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/commands/setchannel.js"
click node_channel_store "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/commands/setchannel.js"
click node_welcome_lookup "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js"
click node_image_rendering "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js"
click node_welcome_delivery "https://github.com/exploit1337/discordjs-welcome-bot/blob/master/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_settings,node_event_handlers,node_command_loader,node_command_dispatch toneBlue
class node_welcome_lookup,node_image_rendering,node_image_sources,node_welcome_delivery toneAmber
class node_set_channel,node_channel_store toneMint
class node_admin,node_member,node_discord toneIndigo
```

## Components

### Bot runtime

- [Bot settings](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/config.json): `config.json`
- [Event handlers](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`
- [Command loader](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`
- [Command dispatch](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`

### Welcome workflow

- [Channel lookup](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`
- [Image rendering](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`
- **Image sources**
- [Welcome delivery](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/index.js): `index.js`

### Channel setup

- [Set channel](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/commands/setchannel.js): `commands/setchannel.js`
- [Channel store](https://github.com/exploit1337/discordjs-welcome-bot/blob/master/commands/setchannel.js): `commands/setchannel.js`

### Other components

- **Administrator**
- **New member**
- **Discord**

## Connections

- Bot settings → Event handlers: provides credentials (evidence: `index.js`)
- Event handlers → Command loader: loads commands (evidence: `index.js`)
- Event handlers → Command dispatch: routes messages (evidence: `index.js`)
- Administrator → Command dispatch: sends command (evidence: `readme.md`)
- Command dispatch → Set channel: runs command (evidence: `index.js`)
- Set channel → Channel store: saves channel (evidence: `commands/setchannel.js`)
- Set channel → Discord: checks channel (evidence: `commands/setchannel.js`)
- New member → Event handlers: joins server (evidence: `index.js`)
- Event handlers → Channel lookup: handles join (evidence: `index.js`)
- Channel lookup → Channel store: fetches channel (evidence: `index.js`)
- Channel lookup → Image rendering: starts rendering (evidence: `index.js`)
- Image sources → Image rendering: supplies images (evidence: `index.js`)
- Image rendering → Welcome delivery: writes image (evidence: `index.js`)
- Welcome delivery → Discord: sends welcome (evidence: `index.js`)
