# gamestar911/raven-bot architecture

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

- Interactive diagram: https://gitdiagram.com/gamestar911/raven-bot
- Repository: https://github.com/gamestar911/raven-bot

## Overview

RAVEN-BOT is a multi-device WhatsApp bot. Users send commands or messages through WhatsApp; the bot connects with Baileys, handles bot behavior, and replies in chats. The README highlights group management, media commands, and AI features, while sampled command code also shows search, downloads, and informational responses. Session credentials support the connection, and an in-memory store maintains chat-related state. The command-dispatch wiring and several documented features were not sampled, so their internal links are left out; the feature branches use the command module path as the available evidence.

Main entry points: [`action/raven.js`](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js) (Command handling), [`action/index.js`](https://github.com/gamestar911/raven-bot/blob/main/action/index.js) (Baileys connection), [`index.js`](https://github.com/gamestar911/raven-bot/blob/main/index.js) (Process entry), [`session/creds.json`](https://github.com/gamestar911/raven-bot/blob/main/session/creds.json) (Session credentials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_entry["Process entry<br/>[index.js]"]
  node_connection["Baileys connection<br/>[index.js]"]
end

subgraph group_features["Bot features"]
  node_commands["Command handling<br/>[raven.js]"]
  node_group["Group management<br/>[raven.js]"]
  node_ai["AI features<br/>[raven.js]"]
  node_search["Search and info<br/>[raven.js]"]
  node_media_commands["Media commands<br/>[raven.js]"]
end

subgraph group_state["Session and state"]
  node_session["Session credentials<br/>[creds.json]"]
  node_store[("In-memory state<br/>[store.js]")]
end

subgraph group_media["Media utilities"]
  node_sticker["Sticker conversion<br/>[ravenexif.js]"]
  node_uploads["Media uploads<br/>[ravenupload.js]"]
  node_image_edit["Image enhancement<br/>[remini.js]"]
end

subgraph group_web["Status web"]
  node_web_server["Status web server<br/>[index.js]"]
  node_pixel_site["Pixel web assets<br/>[index.html]"]
end

node_user(("WhatsApp user"))
node_whatsapp(("WhatsApp"))
node_ai_services["AI and content APIs"]
node_media_services["Media services"]

node_user -->|"sends messages"| node_whatsapp
node_whatsapp -->|"delivers events"| node_connection
node_entry -->|"loads"| node_connection
node_connection -->|"connects"| node_whatsapp
node_connection -->|"saves credentials"| node_session
node_connection -.->|"maintains state"| node_store
node_commands -->|"sends replies"| node_whatsapp
node_commands -.->|"requests AI/content"| node_ai_services
node_commands -.->|"requests media"| node_media_services
node_commands -.->|"converts stickers"| node_sticker
node_commands -.->|"uploads media"| node_uploads
node_commands -.->|"enhances images"| node_image_edit
node_entry -->|"starts server"| node_web_server
node_web_server -->|"serves assets"| node_pixel_site

click node_entry "https://github.com/gamestar911/raven-bot/blob/main/index.js"
click node_connection "https://github.com/gamestar911/raven-bot/blob/main/action/index.js"
click node_commands "https://github.com/gamestar911/raven-bot/blob/main/action/raven.js"
click node_group "https://github.com/gamestar911/raven-bot/blob/main/action/raven.js"
click node_ai "https://github.com/gamestar911/raven-bot/blob/main/action/raven.js"
click node_search "https://github.com/gamestar911/raven-bot/blob/main/action/raven.js"
click node_media_commands "https://github.com/gamestar911/raven-bot/blob/main/action/raven.js"
click node_session "https://github.com/gamestar911/raven-bot/blob/main/session/creds.json"
click node_store "https://github.com/gamestar911/raven-bot/blob/main/store/store.js"
click node_sticker "https://github.com/gamestar911/raven-bot/blob/main/lib/ravenexif.js"
click node_uploads "https://github.com/gamestar911/raven-bot/blob/main/lib/ravenupload.js"
click node_image_edit "https://github.com/gamestar911/raven-bot/blob/main/lib/remini.js"
click node_web_server "https://github.com/gamestar911/raven-bot/blob/main/action/index.js"
click node_pixel_site "https://github.com/gamestar911/raven-bot/blob/main/pixel/index.html"

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_entry,node_connection,node_user toneBlue
class node_commands,node_group,node_ai,node_search,node_media_commands toneAmber
class node_session,node_store,node_ai_services toneMint
class node_sticker,node_uploads,node_image_edit toneRose
class node_web_server,node_pixel_site,node_whatsapp,node_media_services toneIndigo
```

## Components

### Bot runtime

- [Process entry](https://github.com/gamestar911/raven-bot/blob/main/index.js): `index.js`
- [Baileys connection](https://github.com/gamestar911/raven-bot/blob/main/action/index.js): `action/index.js`

### Bot features

- [Command handling](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js): `action/raven.js`
- [Group management](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js): `action/raven.js`
- [AI features](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js): `action/raven.js`
- [Search and info](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js): `action/raven.js`
- [Media commands](https://github.com/gamestar911/raven-bot/blob/main/action/raven.js): `action/raven.js`

### Session and state

- [Session credentials](https://github.com/gamestar911/raven-bot/blob/main/session/creds.json): `session/creds.json`
- [In-memory state](https://github.com/gamestar911/raven-bot/blob/main/store/store.js): `store/store.js`

### Media utilities

- [Sticker conversion](https://github.com/gamestar911/raven-bot/blob/main/lib/ravenexif.js): `lib/ravenexif.js`
- [Media uploads](https://github.com/gamestar911/raven-bot/blob/main/lib/ravenupload.js): `lib/ravenupload.js`
- [Image enhancement](https://github.com/gamestar911/raven-bot/blob/main/lib/remini.js): `lib/remini.js`

### Status web

- [Status web server](https://github.com/gamestar911/raven-bot/blob/main/action/index.js): `action/index.js`
- [Pixel web assets](https://github.com/gamestar911/raven-bot/blob/main/pixel/index.html): `pixel/index.html`

### Other components

- **WhatsApp user**
- **WhatsApp**
- **AI and content APIs**
- **Media services**

## Connections

- WhatsApp user → WhatsApp: sends messages
- WhatsApp → Baileys connection: delivers events
- Process entry → Baileys connection: loads
- Baileys connection → WhatsApp: connects
- Baileys connection → Session credentials: saves credentials
- Baileys connection → In-memory state: maintains state
- Command handling → WhatsApp: sends replies
- Command handling → AI and content APIs: requests AI/content
- Command handling → Media services: requests media
- Command handling → Sticker conversion: converts stickers
- Command handling → Media uploads: uploads media
- Command handling → Image enhancement: enhances images
- Process entry → Status web server: starts server
- Status web server → Pixel web assets: serves assets
