# titannickbub/satbot architecture

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

- Interactive diagram: https://gitdiagram.com/titannickbub/satbot
- Repository: https://github.com/titannickbub/satbot

## Overview

SatBot is a multi-platform community bot. Members interact through independently selectable WhatsApp, Telegram, or Discord integrations; those integrations expose community commands and automated protections, with results delivered back through the chosen platform. The README documents the major capability areas, while the excerpts show selected moderation, configuration, and feature implementations. Since the main dispatcher and most command implementations were not sampled, feature-to-entry-point links are shown as unverified rather than asserted as direct calls.

Main entry points: [`core.js`](https://github.com/titannickbub/satbot/blob/main/core.js) (Command runtime), [`commands/adm`](https://github.com/titannickbub/satbot/tree/main/commands/adm) (Administration), [`middlewares`](https://github.com/titannickbub/satbot/tree/main/middlewares) (Automatic protections), [`functions/antiraidHelper.js`](https://github.com/titannickbub/satbot/blob/main/functions/antiraidHelper.js) (Anti-raid rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platforms["Platform integrations"]
  node_whatsapp["WhatsApp adapter<br/>[whatsapp.js]"]
  node_telegram["Telegram adapter<br/>[telegram.js]"]
  node_discord["Discord adapter<br/>[discord.js]"]
end

subgraph group_runtime["Bot runtime"]
  node_entry["Startup<br/>[index.js]"]
  node_dispatcher["Command runtime<br/>[core.js]"]
  node_web["Web dashboard<br/>[webServer.js]"]
end

subgraph group_community["Community management"]
  node_admin["Administration"]
  node_moderation["Member moderation"]
  node_automatic["Automatic protections"]
  node_anti_link["Anti-link rules<br/>[antilinkHelper.js]"]
  node_anti_raid["Anti-raid rules<br/>[antiraidHelper.js]"]
  node_community_settings[("Community settings<br/>[groupSettings.js]")]
end

subgraph group_progression["Member features"]
  node_economy_commands["Economy commands"]
  node_economy["Virtual economy<br/>[economy.js]"]
  node_xp_commands["XP commands<br/>[xp.js]"]
  node_xp["XP progression<br/>[xp.js]"]
  node_profiles["Profiles and accounts<br/>[profiles.js]"]
  node_entertainment["Entertainment and RPG"]
  node_marriage["Marriage service<br/>[marriageService.js]"]
  node_ai_downloads["AI and downloads"]
end

subgraph group_services["Shared services"]
  node_configuration[("Bot configuration<br/>[config.js]")]
  node_owners[("Owner access<br/>[owners.js]")]
  node_scheduler["Scheduled tasks<br/>[schedulerHelper.js]"]
  node_api["API and media<br/>[api.js]"]
end

node_members(("Community members"))

node_members -->|"use bot"| node_whatsapp
node_members -->|"use bot"| node_telegram
node_members -->|"use bot"| node_discord
node_entry -->|"loads runtime"| node_dispatcher
node_entry -->|"loads dashboard"| node_web
node_whatsapp -.->|"dispatches commands"| node_dispatcher
node_telegram -.->|"dispatches commands"| node_dispatcher
node_discord -.->|"dispatches commands"| node_dispatcher
node_dispatcher -.->|"exposes commands"| node_admin
node_dispatcher -.->|"exposes commands"| node_economy_commands
node_dispatcher -.->|"exposes commands"| node_xp_commands
node_dispatcher -.->|"exposes commands"| node_entertainment
node_dispatcher -.->|"exposes commands"| node_ai_downloads
node_dispatcher -.->|"runs protections"| node_automatic
node_automatic -.->|"uses rules"| node_anti_link
node_automatic -->|"uses rules"| node_anti_raid
node_anti_raid -->|"applies actions"| node_moderation
node_anti_raid -->|"resolves settings"| node_community_settings
node_economy_commands -->|"uses economy"| node_economy
node_xp_commands -->|"uses XP"| node_xp
node_entertainment -.->|"offers marriage"| node_marriage
node_economy -->|"uses accounts"| node_profiles
node_configuration -.->|"separate settings"| node_community_settings
node_admin -->|"checks owner access"| node_owners
node_admin -.->|"configures protections"| node_configuration

click node_whatsapp "https://github.com/titannickbub/satbot/blob/main/platforms/whatsapp.js"
click node_telegram "https://github.com/titannickbub/satbot/blob/main/platforms/telegram.js"
click node_discord "https://github.com/titannickbub/satbot/blob/main/platforms/discord.js"
click node_entry "https://github.com/titannickbub/satbot/blob/main/index.js"
click node_dispatcher "https://github.com/titannickbub/satbot/blob/main/core.js"
click node_web "https://github.com/titannickbub/satbot/blob/main/functions/webServer.js"
click node_admin "https://github.com/titannickbub/satbot/tree/main/commands/adm"
click node_moderation "https://github.com/titannickbub/satbot/blob/main/functions/moderationHelper.js"
click node_automatic "https://github.com/titannickbub/satbot/tree/main/middlewares"
click node_anti_link "https://github.com/titannickbub/satbot/blob/main/functions/antilinkHelper.js"
click node_anti_raid "https://github.com/titannickbub/satbot/blob/main/functions/antiraidHelper.js"
click node_community_settings "https://github.com/titannickbub/satbot/blob/main/functions/groupSettings.js"
click node_economy_commands "https://github.com/titannickbub/satbot/tree/main/commands/economia"
click node_economy "https://github.com/titannickbub/satbot/blob/main/functions/economy.js"
click node_xp_commands "https://github.com/titannickbub/satbot/blob/main/commands/contas/xp.js"
click node_xp "https://github.com/titannickbub/satbot/blob/main/functions/xp.js"
click node_profiles "https://github.com/titannickbub/satbot/blob/main/functions/profiles.js"
click node_entertainment "https://github.com/titannickbub/satbot/tree/main/commands/diversao"
click node_marriage "https://github.com/titannickbub/satbot/blob/main/functions/marriageService.js"
click node_ai_downloads "https://github.com/titannickbub/satbot/tree/main/commands/ia"
click node_configuration "https://github.com/titannickbub/satbot/blob/main/functions/config.js"
click node_owners "https://github.com/titannickbub/satbot/blob/main/functions/owners.js"
click node_scheduler "https://github.com/titannickbub/satbot/blob/main/functions/schedulerHelper.js"
click node_api "https://github.com/titannickbub/satbot/blob/main/functions/api.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_whatsapp,node_telegram,node_discord toneBlue
class node_entry,node_dispatcher,node_web toneAmber
class node_admin,node_moderation,node_automatic,node_anti_link,node_anti_raid,node_community_settings toneMint
class node_economy_commands,node_economy,node_xp_commands,node_xp,node_profiles,node_entertainment,node_marriage,node_ai_downloads toneRose
class node_configuration,node_owners,node_scheduler,node_api,node_members toneIndigo
```

## Components

### Platform integrations

- [WhatsApp adapter](https://github.com/titannickbub/satbot/blob/main/platforms/whatsapp.js): `platforms/whatsapp.js`
- [Telegram adapter](https://github.com/titannickbub/satbot/blob/main/platforms/telegram.js): `platforms/telegram.js`
- [Discord adapter](https://github.com/titannickbub/satbot/blob/main/platforms/discord.js): `platforms/discord.js`

### Bot runtime

- [Startup](https://github.com/titannickbub/satbot/blob/main/index.js): `index.js`
- [Command runtime](https://github.com/titannickbub/satbot/blob/main/core.js): `core.js`
- [Web dashboard](https://github.com/titannickbub/satbot/blob/main/functions/webServer.js): `functions/webServer.js`

### Community management

- [Administration](https://github.com/titannickbub/satbot/tree/main/commands/adm): `commands/adm`
- [Member moderation](https://github.com/titannickbub/satbot/blob/main/functions/moderationHelper.js): `functions/moderationHelper.js`
- [Automatic protections](https://github.com/titannickbub/satbot/tree/main/middlewares): `middlewares`
- [Anti-link rules](https://github.com/titannickbub/satbot/blob/main/functions/antilinkHelper.js): `functions/antilinkHelper.js`
- [Anti-raid rules](https://github.com/titannickbub/satbot/blob/main/functions/antiraidHelper.js): `functions/antiraidHelper.js`
- [Community settings](https://github.com/titannickbub/satbot/blob/main/functions/groupSettings.js): `functions/groupSettings.js`

### Member features

- [Economy commands](https://github.com/titannickbub/satbot/tree/main/commands/economia): `commands/economia`
- [Virtual economy](https://github.com/titannickbub/satbot/blob/main/functions/economy.js): `functions/economy.js`
- [XP commands](https://github.com/titannickbub/satbot/blob/main/commands/contas/xp.js): `commands/contas/xp.js`
- [XP progression](https://github.com/titannickbub/satbot/blob/main/functions/xp.js): `functions/xp.js`
- [Profiles and accounts](https://github.com/titannickbub/satbot/blob/main/functions/profiles.js): `functions/profiles.js`
- [Entertainment and RPG](https://github.com/titannickbub/satbot/tree/main/commands/diversao): `commands/diversao`
- [Marriage service](https://github.com/titannickbub/satbot/blob/main/functions/marriageService.js): `functions/marriageService.js`
- [AI and downloads](https://github.com/titannickbub/satbot/tree/main/commands/ia): `commands/ia`

### Shared services

- [Bot configuration](https://github.com/titannickbub/satbot/blob/main/functions/config.js): `functions/config.js`
- [Owner access](https://github.com/titannickbub/satbot/blob/main/functions/owners.js): `functions/owners.js`
- [Scheduled tasks](https://github.com/titannickbub/satbot/blob/main/functions/schedulerHelper.js): `functions/schedulerHelper.js`
- [API and media](https://github.com/titannickbub/satbot/blob/main/functions/api.js): `functions/api.js`

### Other components

- **Community members**

## Connections

- Community members → WhatsApp adapter: use bot (evidence: `README.md`)
- Community members → Telegram adapter: use bot (evidence: `README.md`)
- Community members → Discord adapter: use bot (evidence: `README.md`)
- Startup → Command runtime: loads runtime (evidence: `index.js`)
- Startup → Web dashboard: loads dashboard (evidence: `index.js`)
- WhatsApp adapter → Command runtime: dispatches commands
- Telegram adapter → Command runtime: dispatches commands
- Discord adapter → Command runtime: dispatches commands
- Command runtime → Administration: exposes commands
- Command runtime → Economy commands: exposes commands
- Command runtime → XP commands: exposes commands
- Command runtime → Entertainment and RPG: exposes commands
- Command runtime → AI and downloads: exposes commands
- Command runtime → Automatic protections: runs protections
- Automatic protections → Anti-link rules: uses rules
- Automatic protections → Anti-raid rules: uses rules (evidence: `middlewares/antiraid.js`)
- Anti-raid rules → Member moderation: applies actions (evidence: `middlewares/antiraid.js`)
- Anti-raid rules → Community settings: resolves settings (evidence: `functions/antiraidHelper.js`)
- Economy commands → Virtual economy: uses economy (evidence: `commands/economia/buscasinais.js`)
- XP commands → XP progression: uses XP (evidence: `commands/contas/xp.js`)
- Entertainment and RPG → Marriage service: offers marriage
- Virtual economy → Profiles and accounts: uses accounts (evidence: `functions/economy.js`)
- Bot configuration → Community settings: separate settings
- Administration → Owner access: checks owner access (evidence: `commands/adm/seguranca/antilink.js`)
- Administration → Bot configuration: configures protections
