Step-by-step instructions for creating and configuring a Discord bot for SaloonBot.
- Go to the Discord Developer Portal.
- Click New Application.
- Enter a name (e.g. "SaloonBot") and click Create.
- In the left sidebar, click Bot.
- Click Reset Token, then copy and save the token securely. You will need it later.
Warning: Treat this token like a password. Never commit it to version control.
Still on the Bot page, scroll down to Privileged Gateway Intents and enable:
- Message Content Intent — required for reading in-channel game commands (e.g.
bet 50,hit,stand)
Click Save Changes.
- In the left sidebar, click OAuth2 → URL Generator.
- Under Scopes, check:
botapplications.commands
- Under Bot Permissions, check:
- View Channels
- Send Messages
- Send Messages in Threads
- Embed Links
- Read Message History
- Copy the generated URL at the bottom of the page.
- Paste the invite URL into your browser.
- Select the server you want to add the bot to.
- Click Authorize and complete the CAPTCHA.
- Open Discord and go to User Settings → Advanced.
- Enable Developer Mode.
- Right-click your server name in the left sidebar and select Copy Server ID. Save this value — it is your guild ID.
The bot requires two pieces of configuration: the bot token and the guild ID(s).
Create two files in the project root:
discord_token.txt ← paste your bot token here
discord_guilds.txt ← paste your guild ID here (comma-separated for multiple guilds)
These files are read by docker-compose via the DISCORD_TOKEN_FILE and DISCORD_GUILDS_FILE environment variables.
export DISCORD_TOKEN="your-bot-token"
export DISCORD_GUILDS="your-guild-id" # comma-separated for multiple guildsSee README.md for full development and production run options. Quick start:
Production (all services in Docker):
docker compose up -dBot only locally (server in Docker):
export DISCORD_TOKEN="your-bot-token"
export DISCORD_GUILDS="your-guild-id"
./dev-bot.sh- In your Discord server, type
/versionin any channel the bot can see. - The bot should respond with the current git SHA or version string.
- Try
/wwnameto generate a random Old West name. - Try
/newgameto start a blackjack game.
| Symptom | Likely cause |
|---|---|
| Bot is online but slash commands don't appear | applications.commands scope was not selected when inviting; re-invite with the correct URL |
Bot can't read bet/hit/stand messages |
Message Content Intent is not enabled in the Developer Portal |
| Bot goes offline immediately | Token is incorrect or the DISCORD_TOKEN / discord_token.txt is not set |
| Game embeds don't display | Embed Links permission is missing |