Campaign Codex is a D&D 5e campaign manager with a built-in AI Dungeon Master. Play through the web app, Discord, or SMS — all channels stay in sync.
You create a campaign called "The Lost Mines of Phandelver".
Your join code is XK7M. Share this with your players.
/setup XK7M in their Discord server/join your_username to link their Discord account/verify XK7M to confirm/join sarah_the_bold → Links your Discord to your web account "sarah_the_bold"
/verify XK7M → Confirms you're in the campaign, shows your character
When the DM runs /setup, the bot creates these channels:
| Channel | Purpose |
|---|---|
#tavern | Main play channel — player actions happen here |
#quests | Quest log and objectives |
#combat | Combat encounters with initiative and HP tracking |
#lore | World lore, history, and discoveries |
#dm-notes | DM-only channel for private notes |
#bot-log | Bot activity log |
| Command | What it does | Example |
|---|---|---|
/action |
Do anything — the AI DM interprets your intent | /action I search the chest for traps |
/roll |
Roll dice | /roll 2d6+3 |
/attack |
Attack a target | /attack Goblin |
/check |
Make a skill check | /check Perception |
/cast |
Cast a spell | /cast Fireball |
/save |
Make a saving throw | /save Dexterity |
/stats |
View your character sheet | /stats |
/inventory |
Check your gear | /inventory |
| Command | What it does | Example |
|---|---|---|
/scene |
Set the scene with narration | /scene The cave entrance yawns before you, cold air rushing out |
/npc add |
Add an NPC to the scene | /npc add Gundren Rockseeker |
/npc say |
Have an NPC speak | /npc say Gundren "Well met, adventurers!" |
/combat start |
Start combat and roll initiative | /combat start |
/combat next |
Advance to next turn | /combat next |
/combat end |
End combat | /combat end |
/damage |
Deal damage to a creature | /damage Goblin 8 |
/heal |
Heal a creature | /heal Thorin 10 |
/loot |
Announce loot | /loot 50 gold and a Potion of Healing |
/whisper |
Send a private message to a player | /whisper @Sarah You notice poison on the goblin's blade |
/condition add |
Apply a condition | /condition add Goblin Poisoned |
/condition remove |
Remove a condition | /condition remove Goblin Poisoned |
/recap |
AI-generated session recap | /recap |
Players can text their actions to the AI DM using plain English. No commands to memorize.
Just text what your character does. The AI DM figures out the rest.
You text: I search the room for traps
AI DM replies:
[Perception 18] Your trained eyes catch a glint of wire stretched across the doorframe. A tripwire — connected to a crossbow bolt mechanism in the wall. (DC 15 — Pass)
You text: I swing my sword at the goblin
AI DM replies:
[Attack vs Goblin: 17 HIT, 8 dmg] Your blade arcs through the torchlight and bites deep into the goblin's shoulder. It screeches and stumbles backward. (HP: 2/7)
You text: I ask the innkeeper what he knows about the missing miners
AI DM replies:
The innkeeper leans close, voice dropping. "Ain't seen Gundren in a tenday. Last I heard, he was headed to Cragmaw Hideout with that sellsword Sildar. Folks say goblins got 'em." He wipes down a glass nervously.
SMS actions automatically appear in Discord (if connected) and in the campaign's combat log on the web.
The AI DM is powered by xAI's Grok model. It handles two things:
Reads the player's natural language and determines: is this an attack? A skill check? A spell? Pure roleplay? It extracts the target, ability, and skill automatically.
After the game engine resolves the mechanics (dice rolls, AC checks, damage), the AI narrates the result in atmospheric, in-character prose. For SMS, it keeps responses under 300 characters.
The AI DM never fudges dice or invents rules. All mechanics go through the same engine that powers the web app — real d20 rolls, real AC calculations, real skill modifiers from your character sheet.
| Create a campaign | Web app → DM Dashboard → + New Campaign |
| Connect to Discord | Invite bot → type /setup JOIN_CODE in your server |
| Enable SMS | Campaign page → SMS Play Mode → Enable → add player phones |
| Run diagnostics | Web app → sidebar → Diagnostics |
| Set a scene | Discord: /scene | Web: campaign narration panel |
| Start combat | Discord: /combat start | Web: combat panel |
| Join a campaign | Web: enter join code | Discord: /join + /verify |
| Do something | Discord: /action | SMS: just text it |
| Roll dice | Discord: /roll 2d6+3 | SMS: "I roll perception" |
| Attack | Discord: /attack Goblin | SMS: "I attack the goblin" |
| Check your stats | Discord: /stats | Web: character sheet |
| Stop SMS | Text STOP to unsubscribe |
No matter how a player takes an action — web, Discord, or SMS — the result shows up everywhere:
#tavern channel
Player Phone → Twilio → AI DM → Game Engine → Narration → SMS + Discord + Web