A Discord bot for running an Alternate Reality Game (ARG). Players solve puzzles, unlock lore, track their progress, and the bot can broadcast messages and greet new tickets automatically.
- š® Puzzle posting ā Post encrypted clues that players must solve
- ā Answer checking ā Players submit answers; the bot verifies them
- š Progress tracking ā Track which puzzles each player has solved (SQLite-backed)
- š Hidden lore drops ā Reveal story snippets when puzzles are solved
- š¢ Message broadcasting ā Send custom messages to any channel via
/say - š« Ticket greetings ā Send one of 3 random programmed messages when a ticket is opened
Create a Discord application at https://discord.com/developers/applications, then set these env vars:
š Add DISCORD_BOT_TOKEN here: https://www.val.town/x/spiderjeremy/arg-discord-bot/environment-variables?key=DISCORD_BOT_TOKEN
š Add DISCORD_PUBLIC_KEY here: https://www.val.town/x/spiderjeremy/arg-discord-bot/environment-variables?key=DISCORD_PUBLIC_KEY
š Add DISCORD_APP_ID here: https://www.val.town/x/spiderjeremy/arg-discord-bot/environment-variables?key=DISCORD_APP_ID
š Add DISCORD_GUILD_ID here: https://www.val.town/x/spiderjeremy/arg-discord-bot/environment-variables?key=DISCORD_GUILD_ID
Optional ā only needed if your ticket channels live in a specific category:
š Add DISCORD_TICKET_CATEGORY_ID here: https://www.val.town/x/spiderjeremy/arg-discord-bot/environment-variables?key=DISCORD_TICKET_CATEGORY_ID
Run register_commands.ts from the Val Town editor to register the bot's slash commands with Discord.
In the Discord Developer Portal ā your app ā General Information ā Interactions Endpoint URL, paste the HTTP endpoint URL of main.ts (found on the val page).
Use the OAuth2 URL Generator in the Discord Developer Portal with the applications.commands and bot scopes. Give the bot Send Messages and View Channels permissions.
The ticket_watcher.ts interval runs every 15 minutes and automatically sends a random greeting to any new ticket channel it detects. Make sure DISCORD_GUILD_ID is set. If your ticket bot creates channels in a specific category, set DISCORD_TICKET_CATEGORY_ID to that category's ID for precise detection. Without it, the watcher greets any new text channel whose name starts with "ticket".
| Command | Description |
|---|---|
/puzzle | View the current unsolved puzzle |
/submit <answer> | Submit an answer to the current puzzle |
/progress | Check your puzzle-solving progress and rank |
/lore | View the lore you've unlocked so far |
/say <channel> <message> | Send a custom message to a specific channel |
/greet | Send a random ticket greeting to the current channel |
Edit puzzles.ts to add your own puzzles, answers, and lore. Each puzzle has:
promptā The clue shown to playersanswersā Array of accepted answers (case-insensitive)loreā Story text revealed when the puzzle is solved
Edit ticket_greetings.ts to change the 3 random messages sent when a ticket is opened. The bot picks one at random each time.
main.ts HTTP endpoint ā receives & verifies Discord interactions
register_commands.ts Script ā registers slash commands with Discord API
db.ts SQLite helper ā tracks player solve progress & greeted channels
puzzles.ts Puzzle data ā prompts, answers, and lore
ticket_greetings.ts Ticket greeting messages ā 3 random options
ticket_watcher.ts Interval ā auto-detects new ticket channels & sends greetings