Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Bot-Forge

Discord AI Bot Games — Powered by Local & Cloud LLMs

Buy Me a Coffee

Created by DrGekoz

Ship fast then refine.


Bot-Forge is a complete framework for running AI-powered game bots in Discord voice channels. Multiple bots with distinct personalities and voice clones compete, debate, improvise, and play games together — all through TTS audio in real-time voice chat.

Every game mode runs with file-based turn management (no Discord message spam between bots), works with local LLMs (LM Studio, Ollama, vLLM), cloud APIs (OpenAI, Gemini, OpenRouter, OpenCode GO), and uses PocketTTS for voice cloning.


✨ Features

  • Voice Chat TTS — Bots speak through Discord voice channels with cloned voices
  • Async Pre-Generation Pipeline — While one bot plays audio in VC, others generate LLM responses + TTS in parallel. Games can finish computationally before audio finishes playing. 0.5s gap between speakers for natural flow.
  • Multi-Provider — LM Studio, Ollama, vLLM, OpenAI, Gemini, OpenRouter, OpenCode GO
  • Per-Bot Personalities — Each bot gets its own system prompt + voice clone
  • Persistent Memory — Bots remember users, preferences, and conversation history across sessions via built-in SQLite store + holographic memory
  • PocketTTS Voice Cloning — Upload a 10-second reference, get a voice clone
  • File-Based IPC — Bot-to-bot comms use JSON state files, not Discord channel messages
  • Memory API Server — HTTP endpoint for bots to recall/store memories at runtime
  • Voice Activity Detection — Optional Silero VAD + faster-whisper for speech-to-text listening mode
  • Text Channel Mode — Run games in text channels instead of VC (optional)
  • "Not Enough Bots" Guard — Every game validates minimum bot count before starting
  • Bot Name Resolution — Type referee:Sassy or good_cop:Bob instead of copying Discord IDs. Works everywhere — /game, /dream_weave, /interrogate, etc.
  • Auction House → Show & Tell Pipeline — Items purchased at auction are auto-saved to holographic memory inventory. Present them later in Show & Tell!
  • Stale Lock Cleanup — Auto-removes .llmcord.lock files from crashed runs on restart

Included Game Modes

Mode Players Description
20 Questions 1 Picker + 2+ Guessers + 1 Referee One bot secretly picks a person/place/thing, others ask yes/no questions to guess it within 20 tries
Alt History Think Tank 📚 2+ Bots Bots discuss real events through alternate era worldviews (steampunk, cyberpunk, etc.)
Auction House 🏪 1 Auctioneer + 2+ Bidders Fast-talking auctioneer sells bizarre items, bidders compete with virtual budgets — purchased items saved to holographic memory inventory!
Comedy Roast Battle 🎤 1 Emcee + 2+ Comedians + 1 Referee Terrible jokes, heckling, referee silently scores
Council 🏛️ 2+ Members + 1 Referee Evidence-gated consensus building with blind review
Debate Arena 🎙️ 2+ Debaters + 1 Referee Structured debate with silent scoring + winner declaration
DND Campaign 🎲 1 DM + 1+ Heroes Full D&D-style campaign with auto dice rolling
Dream Interpretation 🌙 1 Dreamer + 2 Analysts + 1 Referee Bots interpret surreal AI dreams through Freudian vs Cosmic lenses, scored by a referee — assign dreamer by name!
Group Chat 💬 2+ Bots Natural voice channel conversation
Interrogation Room 🚔 Good Cop + Bad Cop + Suspect Good Cop/Bad Cop tag-team interrogate a suspect, confession detection — assign roles by name!
MTG Battle ⚔️ 2+ Duelists + 1 Referee Magic-style spell duels with counters, damage, and persistent stats across sessions
The Infinite Podcast 🎧 1 Host + 2 Guests Tech news discussion with RSS-fed articles
Poetry Slam 🏆 2+ Poets + 1 Referee Rhyming verses targeting the last line, scored on rhyme/creativity/burn
Pokemon Battle 2+ Fighters + 1 Referee Turn-based Pokemon-style battles with type effectiveness, style points, and persistent leveling via holographic memory
Show & Tell 🎤 2+ Presenters + 1 Referee Bots present items from their holographic memory inventory, roast each other's items — scored on pitch and roast quality
Turing Test Panel 🤖 3+ Panelists + 1 Referee "Who's human?" — plot twist: they're ALL AI

🚀 Quick Start

1. Run Setup

cd Bot-Forge
Setup.bat

Setup.bat is an interactive wizard that handles everything. It will prompt you for every detail — run it once and follow the prompts.

2. What Setup.bat Does

  1. Checks Python + Git installation
  2. Detects any existing bot configs and asks before overwriting
  3. Installs Python dependencies (discord.py, httpx, openai, pyyaml)
  4. Asks how many bots you want (minimum 2 for games)
  5. Prints step-by-step Discord Developer Portal instructions (MESSAGE CONTENT INTENT is CRITICAL)
  6. For each bot: collects name, token, personality prompt, voice reference
  7. Installs Silero VAD + faster-whisper for voice listening (optional)
  8. Asks Text Channel Mode — run games in text instead of voice (optional)
  9. Installs PocketTTS if not already present (or detects existing)
  10. Creates voice clones from your reference files
  11. Generates all config files and start scripts
  12. Prints invite URLs for each bot

3. Invite Bots

Use the invite URLs generated by Setup.bat. Add all bots to your Discord server.

4. Start Everything

start_bot_forge.bat

Or directly with colored logs:

python run_bot_forge.py

This single command launches the memory server (if enabled), PocketTTS (if installed), and all bot instances — each with its own labeled log output in one terminal.

5. Play!

Join a voice channel in Discord. You'll need Developer Mode enabled to copy bot IDs.

Quick Start Flow

1. Invite bots to your server — use the invite URLs from Setup.bat output

2. Get bots into voice chat — run this on EACH bot individually:

/join

Each bot must join the VC separately (they're separate Discord accounts).

3. Start a game — run this on ANY ONE bot:

/game mode:debate topic:"Cats vs Dogs" rounds:3

or use an individual command:

/dream_weave
/auction_house

That's it — no /group start needed. The game command auto-detects all bots in VC, assigns roles, and starts the turn-based conversation. The bots will talk to each other in voice chat automatically.

For free-form conversation (no game rules): use /group start after all bots join.

Bot Name Resolution (No More Copying IDs!)

You can now type bot names instead of Discord IDs in any command:

  • referee:Sassy — set Sassy as the referee
  • good_cop:Bob bad_cop:Kanye suspect:Sassy — assign roles by name
  • dreamer:Sassy — set Sassy as the dreamer
  • referee:@Sassy the Sasquatch — full display name works too

The system matches display names exactly first, then falls back to partial/substring matching. Works everywhere — /game, /20_questions, /dream_weave, /interrogate, etc.

Still works with Discord IDs and @mentions too — backward compatible.

Starting a Game

Option A — Unified /game command (recommended):

/game mode:<type> topic:"..." rounds:N referee:@Bot
Parameter What it's for
mode Game type: debate, council, auction, 20questions, show_tell, pokemon, mtg, dream, comedy, poetry, interrogation, turing, althistory, podcast, ttrpg
topic Required for debate / council / althistory / podcast — the discussion topic
rounds Number of rounds (default: 3)
referee @mention or bot name (e.g. Sassy, @Sassy the Sasquatch) to choose the referee. Leave blank for auto — uses the designated referee bot
category For 20questions: person, place, or thing (default: thing)

New! Use bot names instead of IDs: referee:Sassy, referee:@Sassy the Sasquatch — works everywhere.

Designated Referee: During Setup.bat, you chose one bot as the permanent referee. That bot will automatically judge all games unless you override with referee:@Bot or referee:Sassy in the command.

Examples:

/game mode:debate topic:"Cats are better than dogs" rounds:3 referee:Sassy
/game mode:20questions category:person referee:Rogan
/game mode:auction
/game mode:pokemon
/game mode:dream referee:Sassy
/game mode:interrogation referee:Rogan
/game mode:comedy rounds:2
/game mode:poetry rounds:3
/game mode:turing rounds:3
/game mode:ttrpg rounds:10

❌ If you miss a required parameter (e.g. no topic for debate), the bot will show an error with the correct format. The command never sends your input to the LLM — it only routes to the game engine.

Option B — Individual commands:

/join              # Bot joins your VC
/debate topic:... rounds:3 referee_id:<name or ID>
/council topic:... rounds:3 referee_id:<name or ID>
/auction_house budget:10000
/20_questions category:thing referee_id:<name or ID>
/show_tell referee_id:<name or ID>
/pokemon_battle referee_id:<name or ID>
/mtg_battle referee_id:<name or ID>
/dream_weave dream:"describe your dream" dreamer:Sassy referee_id:<name or ID>
/comedy_roast rounds:2 referee_id:<name or ID>
/poetry_slam rounds:3 referee_id:<name or ID>
/interrogate rounds:5 good_cop:Sassy bad_cop:Kanye suspect:Bob referee_id:<name or ID>
/turing_test rounds:3 referee_id:<name or ID>
/alt_history topic:"What if Rome never fell?" referee_id:<name or ID>
/podcast topic:"AI in 2026" rounds:5 referee_id:<name or ID>
/ttrpg rounds:10 referee_id:<name or ID>
/group start       # Free-form conversation mode
/group stop        # End the session

Tip: Use /game mode:... for a unified experience with better error messages and the @mention-referee pattern.

6. Re-running Setup

Run Setup.bat again at any time. It will detect your existing configs and ask whether to overwrite them or create new ones alongside them.


⚙️ What Setup.bat Asks You

Prompt What it's for
Number of bots How many bot instances to create (2-10)
Bot name Each bot's display identity
Bot token From Discord Developer Portal — MESSAGE CONTENT INTENT must be enabled
Personality prompt Multi-line description of how the bot behaves
Voice reference file 10-second WAV/MP3 for voice cloning (optional)
AI provider LM Studio, Ollama, OpenAI, Gemini, OpenRouter, etc.
API key For cloud providers (OpenAI, Gemini, OpenRouter)
Model name The model each bot uses
Per-bot models? Same model for all, or different per bot
Silero VAD + faster-whisper? Voice Activity Detection + speech-to-text (optional)
Text channel mode? Run games in text channels instead of VC (optional)
PocketTTS model? Download the ~2GB voice model now?
Persistent memory? Enable SQLite memory store for cross-session recall
Referee bot? Which bot judges all games — asked for each bot name during setup

Everything you enter is saved to local config files. Nothing is sent anywhere.


🎤 PocketTTS Voice Cloning

Setup.bat handles PocketTTS installation automatically, but here's what's happening under the hood:

  1. Install: Clones github.com/Kyutai/PocketTTS into pockettts/
  2. Download model: ~2GB voice cloning model (asked during setup)
  3. Create voice refs: You provide a short audio clip per bot
  4. Export clones: pocket-tts export-voice creates a .pt clone per bot
  5. Run server: PocketTTS server on port 8769

Voice Reference Requirements

Property Requirement
Length 8–15 seconds (10s ideal)
Format WAV, MP3, or OGG
Sample rate 16kHz–48kHz (auto-resampled)
Channels Mono or Stereo (auto-converted)
Content Clear speech, minimal background noise
File size Under 5MB

No voice reference = bot uses a default/synthesized voice.


🧠 AI Providers

Local

Provider Base URL Notes
LM Studio http://localhost:1234/v1 Easiest — download from lmstudio.ai
Ollama http://localhost:11434/v1 ollama pull llama3.2:3b
vLLM http://localhost:8000/v1 For advanced GPU setups

Cloud

Provider Base URL Key Required
OpenAI https://api.openai.com/v1
OpenRouter https://openrouter.ai/api/v1
Gemini https://generativelanguage.googleapis.com/v1beta
OpenCode GO Provider-specified
Custom Whatever you enter Optional

Setup.bat asks if you want a shared provider/model for all bots or different ones per bot.


📁 Project Structure (after Setup.bat runs)

Bot-Forge/
├── Setup.bat                  # Interactive installer (run this)
├── README.md
├── LICENSE                    # MIT
├── .gitignore
├── start_bot_forge.bat        # Starts everything (generated)
├── run_bot_forge.py           # Unified Python launcher (colored logs)
│
├── core/
│   ├── llmcord.py             # Bot framework
│   ├── voice_chat.py          # Game mode engine
│   ├── new_game_modes.py      # 20 Questions, Show & Tell, Pokemon/MTG battles
│   ├── memory_store.py        # SQLite persistent memory
│   ├── memory_server.py       # HTTP API for memory
│   └── config-example.yaml
│
├── bots/                      # Generated by Setup.bat
│   ├── YourBotName/
│   │   ├── config.yaml        # Your bot's config
│   │   └── start.bat          # Launcher
│   └── ...
│
├── pockettts/
│   ├── PocketTTS/              # Cloned repo
│   └── voices/                 # Your voice clones
│
├── voice-refs/                 # Your audio reference files
│
├── game-modes/
│   └── README.md
│
└── scripts/
    └── setup_helpers.py

Everything in bots/, voice-refs/, and pockettts/voices/ is yours — generated by Setup.bat and gitignored.


🎮 Commands

Voice Channel

Command Description
/join Bot joins your VC
/leave Bot leaves VC
/vc <mode> Toggle TTS on/off

Game Modes

Command Description Min Bots Referee
/20_questions <category> [referee_id] 20 Questions — one bot picks, others guess 3 Optional — name/ID
/show_tell [referee_id] Show & Tell — bots present inventory items, roast each other 3 Optional — name/ID
/pokemon_battle [referee_id] Pokemon-style turn-based battle with persistent leveling 3 Optional — name/ID
/mtg_battle [referee_id] Magic the Gathering spell duel with counters 2 Optional — name/ID
/auction_house [budget] Auction House — items saved to HM inventory 2 Auctioneer is first bot
/debate <topic> [rounds] [referee_id] Structured debate with referee scoring 3 Optional — name/ID
/council <topic> [rounds] [referee_id] Evidence-gated council with blind review 3 Optional — name/ID
/comedy_roast [rounds] [referee_id] Comedy Roast Battle — emcee + comedians heckle 3 Optional — name/ID
/poetry_slam [rounds] [referee_id] Poetry Slam — rhyming verse battle 3 Optional — name/ID
/interrogate [rounds] [good_cop] [bad_cop] [suspect] [referee_id] Interrogation Room — cops vs suspect 4 Optional — name/ID
/turing_test [rounds] [referee_id] Turing Test Panel — who's human? 4 Optional — name/ID
/alt_history <topic> [referee_id] Alt History Think Tank 2 Optional — name/ID
/podcast <topic> [rounds] [referee_id] The Infinite Podcast 3 Optional — name/ID
/ttrpg [setting] [rounds] [referee_id] DND Campaign with auto dice rolling 2 Optional — name/ID
/dream_weave <dream> [dreamer] [referee_id] Dream Interpretation — assign dreamer by name 4 Optional — name/ID
`/group <start stop status>` Group VC conversation mode

---------|-------------|----------|---------| | /20_questions <category> [referee_id] | 20 Questions — one bot picks, others guess | 3 | Optional — defaults to last bot | | /show_tell [referee_id] | Show & Tell — bots present inventory items, roast each other | 3 | Optional — defaults to last bot | | /pokemon_battle [referee_id] | Pokemon-style turn-based battle with persistent leveling | 3 | Optional — defaults to last bot | | /mtg_battle [referee_id] | Magic the Gathering spell duel with counters | 2 | Optional — defaults to last bot | | /auction_house [budget] | Auction House with budgets and bidding | 2 | Auctioneer is first bot | | /debate <topic> [rounds] [referee_id] | Structured debate with referee scoring | 3 | Optional — defaults to last bot | | /council <topic> [rounds] [referee_id] | Evidence-gated council with blind review | 3 | Optional — defaults to last bot | | /group <start\|stop\|status> | Group VC conversation mode | 2 | — |


🤝 Contributing

Bot-Forge is MIT licensed — fork it, modify it, publish your own version.

  • Pull Requests: New game modes, improvements, bug fixes
  • Issues: Report bugs or suggest features
  • Discord: drgekoz

Adding a Game Mode

Each mode follows the same pattern in core/voice_chat.py:

  1. Constants — prompt templates for each role
  2. State init function
  3. Role detection helpers
  4. Round advancement function
  5. Poll loop integration (flags → prompts → post-reply → advance)
  6. Slash command registration

See game-modes/README.md and the existing modes for templates.


📜 Credits

llmcord by jakobdylanc — Core Discord bot framework. MIT licensed.

PocketTTS by Kyutai — CPU-friendly voice cloning engine. MIT licensed.

Hermes Agent by Nous Research — Holographic Memory system (SQLite fact store with FTS5 full-text search, trust scoring, and HTTP API). Used for persistent bot memory, inventory tracking, and cross-session stat progression in Pokemon/MTG battles. Apache 2.0.

Silero VAD — Voice Activity Detection for speech-to-text listening mode. MIT licensed.

faster-whisper — CTranslate2-based Whisper implementation for real-time speech transcription. MIT licensed.

Bot-Forge Memory — Lightweight SQLite-based persistent memory system built into Bot-Forge. Tags, trust scoring, HTTP API. No external dependencies.

Bot-Forge by DrGekoz — Game modes (including 20 Questions, Show & Tell, Pokemon Battles, MTG Battles), voice chat integration, setup wizard, multi-bot orchestration, and holographic memory integration for persistent bot progression.


Built with ❤️ by DrGekoz
Ship fast then refine.

Buy Me a Coffee

About

Discord AI Bot Games — Multiple bots with cloned voices debate, battle, auction, and play games together in voice chat via local/cloud LLMs. Powered by PocketTTS voice cloning, holographic memory, and file-based IPC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages