Fazel Studio Logo
FAZEL STUDIO
All projects

fazelllyyy/discord-bot-agents

discord-bot-agents

10

Discord Bot Agents

An intelligent Discord server-management agent. Understands natural language (any language), plans skills, executes them on Discord, then replies naturally from real results.

Architecture (intelligence-first)

@Bot <request>   ← single standalone request (no chat memory)
        │
        ▼
 1. PLAN      (1× LLM)  — understand FULL intent, including multi-part / ambiguous
 2. EXECUTE   (Discord) — run all planned skills
 3. SUMMARIZE (1× LLM)  — reply in the user's language from real results

Typically 2 LLM calls per command. Empty @Bot mention alone skips the LLM.

Why not 1 call? A model cannot both choose tools and write a grounded reply after seeing skill outcomes. Multi-intent (“who are you + list channels”) needs both phases.

LayerPathRole
Discord adaptersrc/handler/messageHandler.jsMentions, cooldown, render
Agentsrc/agent/plan → execute → summarize
Skillssrc/skills/Discord actions (34 skills)
Providerssrc/core/providers/Gemini, Groq, Cohere, … + failover
Entity resolvesrc/utils/fuzzyMatch.js#channel / @user mentions, IDs, names

Features

  • Multi-intent & ambiguous requests — planner covers every valid part of the message
  • Language-aware replies — matches the user; English only when ambiguous
  • Mention-safe parsing — Discord autocomplete (<#ID>, <@ID>), #name, raw IDs, and plain names
  • 34 built-in skills — channels, roles, members, moderation, emojis, invites, info queries, …
  • Multi-provider failover — free-tier keys with automatic fallback and round-robin
  • Components V2 UIs — paginated lists and rich layouts
  • Safety — permission checks, hierarchy, owner protection, rate limits

Supported AI Providers

ProviderEnv key(s)
Google GeminiGEMINI_API_KEY
GroqGROQ_API_KEY
CohereCOHERE_API_KEY
MistralMISTRAL_API_KEY
CerebrasCEREBRAS_API_KEY
OpenRouterOPENROUTER_API_KEY
Cloudflare Workers AICLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID
JinaJINA_API_KEY
Comet APICOMETAPI_API_KEY
GitHub ModelsGITHUB_PATH_KEY

Only one provider key is required. Priority order lives in src/config.js.

Setup

git clone https://github.com/fazelllyyy/discord-bot-agents.git
cd discord-bot-agents
npm install
cp .env.example .env
DISCORD_TOKEN=your_discord_bot_token
BOT_NAME=My Bot
GEMINI_API_KEY=your_key_here
npm start

Requires Node.js 18+, a Discord bot token, and Message Content Intent enabled.

Usage

@Bot siapa kamu? dan berikan list channel dalam server ini
@Bot create a red VIP role and give it to @user
@Bot jenis apa channel #general
@Bot timeout @user 10 minutes for spam

Each @Bot message is a standalone request (no conversation memory) — predictable and quota-friendly on free API keys.