# lyfe00011/whatsapp-bot architecture

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

- Interactive diagram: https://gitdiagram.com/lyfe00011/whatsapp-bot
- Repository: https://github.com/lyfe00011/whatsapp-bot

## Overview

WhatsApp User Bot links a user’s WhatsApp account, loads command plugins, and responds to incoming chats with group administration, media processing, downloads, and utility features. The sampled `bot.js` shows connection, plugin loading, scheduling, and chat-update handling; the message-dispatch implementation and several referenced utility modules are absent from the supplied tree, so their internal wiring is not expanded. README-listed capabilities are represented by their plugin modules, but their individual implementations were not sampled.

Main entry points: [`bot.js`](https://github.com/lyfe00011/whatsapp-bot/blob/master/bot.js) (Connection and events), [`plugins/greetings.js`](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/greetings.js) (Greetings and protection), [`plugins/scrapers.js`](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/scrapers.js) (Search and downloads), [`plugins`](https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins) (Command plugins)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_bot["Connection and events<br/>[bot.js]"]
  node_commands["Command plugins"]
  node_language["Localized strings<br/>[language.js]"]
end

subgraph group_groups["Group features"]
  node_admin["Group administration<br/>[admin.js]"]
  node_greetings["Greetings and protection<br/>[greetings.js]"]
  node_groupmute["Group mute<br/>[groupmute.js]"]
end

subgraph group_content["Media and content"]
  node_media["Media transforms<br/>[media.js]"]
  node_docx["Documents and image effects<br/>[docx.js]"]
  node_scrapers["Search and downloads<br/>[scrapers.js]"]
  node_social["Social downloads"]
  node_other["Other utilities"]
end

subgraph group_state["Configuration and state"]
  node_config["Configuration and database<br/>[config.js]"]
  node_session[("Session records<br/>[bot.js]")]
  node_sqlplugins[("Plugin records<br/>[plugin.js]")]
  node_sqlgreetings[("Greeting records<br/>[greetings.js]")]
  node_sqlfilters[("Filter records<br/>[filters.js]")]
end

node_user(("WhatsApp user"))
node_whatsapp(("WhatsApp"))
node_web(("External web services"))

node_user -->|"sends chats"| node_whatsapp
node_whatsapp -->|"delivers chat events"| node_bot
node_bot -->|"connects and replies"| node_whatsapp
node_bot -->|"loads plugins"| node_commands
node_bot -->|"reads and writes"| node_session
node_bot -->|"loads plugin records"| node_sqlplugins
node_bot -->|"syncs database"| node_config
node_admin -->|"manages groups"| node_whatsapp
node_greetings -->|"configures greetings"| node_sqlgreetings
node_greetings -->|"configures filters"| node_sqlfilters
node_groupmute -->|"mutes groups"| node_whatsapp
node_media -->|"downloads and replies"| node_whatsapp
node_docx -->|"processes and replies"| node_whatsapp
node_scrapers -.->|"searches and fetches"| node_web
node_social -.->|"fetches media"| node_web
node_scrapers -->|"sends results"| node_whatsapp
node_other -->|"handles commands"| node_whatsapp
node_commands -->|"gets strings"| node_language

click node_bot "https://github.com/lyfe00011/whatsapp-bot/blob/master/bot.js"
click node_commands "https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins"
click node_admin "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/admin.js"
click node_greetings "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/greetings.js"
click node_groupmute "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/groupmute.js"
click node_media "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/media.js"
click node_docx "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/docx.js"
click node_scrapers "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/scrapers.js"
click node_social "https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins"
click node_other "https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins"
click node_language "https://github.com/lyfe00011/whatsapp-bot/blob/master/language.js"
click node_config "https://github.com/lyfe00011/whatsapp-bot/blob/master/config.js"
click node_session "https://github.com/lyfe00011/whatsapp-bot/blob/master/bot.js"
click node_sqlplugins "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/plugin.js"
click node_sqlgreetings "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/greetings.js"
click node_sqlfilters "https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/filters.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_bot,node_commands,node_language,node_user toneBlue
class node_admin,node_greetings,node_groupmute toneAmber
class node_media,node_docx,node_scrapers,node_social,node_other toneMint
class node_config,node_session,node_sqlplugins,node_sqlgreetings,node_sqlfilters toneRose
class node_whatsapp,node_web toneIndigo
```

## Components

### Bot runtime

- [Connection and events](https://github.com/lyfe00011/whatsapp-bot/blob/master/bot.js): `bot.js`
- [Command plugins](https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins): `plugins`
- [Localized strings](https://github.com/lyfe00011/whatsapp-bot/blob/master/language.js): `language.js`

### Group features

- [Group administration](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/admin.js): `plugins/admin.js`
- [Greetings and protection](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/greetings.js): `plugins/greetings.js`
- [Group mute](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/groupmute.js): `plugins/groupmute.js`

### Media and content

- [Media transforms](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/media.js): `plugins/media.js`
- [Documents and image effects](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/docx.js): `plugins/docx.js`
- [Search and downloads](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/scrapers.js): `plugins/scrapers.js`
- [Social downloads](https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins): `plugins`
- [Other utilities](https://github.com/lyfe00011/whatsapp-bot/tree/master/plugins): `plugins`

### Configuration and state

- [Configuration and database](https://github.com/lyfe00011/whatsapp-bot/blob/master/config.js): `config.js`
- [Session records](https://github.com/lyfe00011/whatsapp-bot/blob/master/bot.js): `bot.js`
- [Plugin records](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/plugin.js): `plugins/sql/plugin.js`
- [Greeting records](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/greetings.js): `plugins/sql/greetings.js`
- [Filter records](https://github.com/lyfe00011/whatsapp-bot/blob/master/plugins/sql/filters.js): `plugins/sql/filters.js`

### Other components

- **WhatsApp user**
- **WhatsApp**
- **External web services**

## Connections

- WhatsApp user → WhatsApp: sends chats
- WhatsApp → Connection and events: delivers chat events
- Connection and events → WhatsApp: connects and replies
- Connection and events → Command plugins: loads plugins
- Connection and events → Session records: reads and writes
- Connection and events → Plugin records: loads plugin records
- Connection and events → Configuration and database: syncs database
- Group administration → WhatsApp: manages groups
- Greetings and protection → Greeting records: configures greetings
- Greetings and protection → Filter records: configures filters
- Group mute → WhatsApp: mutes groups
- Media transforms → WhatsApp: downloads and replies
- Documents and image effects → WhatsApp: processes and replies
- Search and downloads → External web services: searches and fetches
- Social downloads → External web services: fetches media
- Search and downloads → WhatsApp: sends results
- Other utilities → WhatsApp: handles commands
- Command plugins → Localized strings: gets strings
