Public
Discord RPG bot using polls to drive story choices
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A community-driven RPG game where Discord polls decide the hero's fate! Every hour, a new scenario appears in your Discord channel as a poll. The community votes on what the hero should do, and the winning choice becomes the next action in the story.
Rendering mermaid diagram...
- 🐉 6 unique scenarios with 4 choices each (dragon fights, haunted villages, wizard encounters, bandit ambushes, enchanted rivers, skeleton kings)
- 🗳️ Native Discord polls — uses Discord's built-in poll feature, not reactions
- ⏰ Automatic progression — hourly cron job reads results and advances the story
- 📊 Character stats — HP, Gold, XP, Level with progression
- 📜 Adventure log — full history of every round and outcome
- 🌐 Web dashboard — view game state, start games, and manually trigger actions
- Go to your Discord server → Channel Settings → Integrations → Webhooks
- Create a webhook and copy the URL
- Go to Discord Developer Portal
- Create a new application → Bot → copy the token
- Enable the bot in your server with
Read Message Historypermission
| Variable | Description |
|---|---|
DISCORD_WEBHOOK_URL | Your channel's webhook URL |
DISCORD_BOT_TOKEN | Bot token for reading poll results |
DISCORD_CHANNEL_ID | The channel ID where polls are sent |
- Visit the web dashboard and click 🎮 New Game
- The bot sends a scenario + poll to Discord
- Your community votes!
- Every hour, results are checked and the story advances
| File | Purpose |
|---|---|
main.ts | HTTP dashboard & API (Hono) |
poll-checker.ts | Hourly cron job to read polls & advance game |
game/engine.ts | Core game logic |
discord/webhook.ts | Discord webhook & API integration |
shared/scenarios.ts | RPG scenarios and character creation |
shared/types.ts | TypeScript types |
database/migrations.ts | SQLite schema |
database/queries.ts | Database operations |