Discord bot originally built for randomly generating Old West names and now wandering off into card games.
Names were scraped from Mithril and Mages.
/wwname [gender] [number]: GeneratesnumberOld West names by choosing a random first name of the givengenderand a random surname. Thegenderargument accepts any string starting withform. If nogenderis given, a random one is chosen. If not provided,numberdefaults to 1. The output is a newline-joined list of names in the form of<gender emoji> first_name last_name.
/newgamestarts a new game of blackjack. Commands (hit, stand, etc.) are read from messages.
/version: Outputs the current git sha.
SaloonBot provides flexible development workflows using Docker Compose configurations. The bot consists of two main components: the Discord bot (bot.py) and the server component (server.py), both communicating through Redis.
There are three development compose files, each designed for a different workflow:
compose.dev-bot-local.yml- Runs server + redis in Docker, allowing you to runbot.pylocallycompose.dev-server-local.yml- Runs bot + redis in Docker, allowing you to runserver.pylocallycompose.dev-redis-only.yml- Runs only redis in Docker, allowing you to run both components locally
For convenience, helper scripts are provided for each scenario:
./dev-bot.shThis starts the server and redis containers, then runs the bot locally. Requires DISCORD_TOKEN and DISCORD_GUILDS environment variables.
./dev-server.shThis starts the bot and redis containers, then runs the server locally. Requires discord_token.txt and discord_guilds.txt files for the bot container.
./dev-redis.shThis starts only redis. You can then run bot.py and server.py separately in different terminals:
# Terminal 1
export REDIS_HOST=localhost REDIS_PORT=6379 SALOONBOT_DEBUG=1
export DISCORD_TOKEN="your-token" DISCORD_GUILDS="your-guild-ids"
python bot.py
# Terminal 2
export REDIS_HOST=localhost REDIS_PORT=6379 SALOONBOT_DEBUG=1
python server.pyYou can also use Docker Compose directly without the helper scripts:
# Start services
docker compose -f compose.dev-bot-local.yml up -d
# View logs
docker compose -f compose.dev-bot-local.yml logs -f
# Stop services
docker compose -f compose.dev-bot-local.yml downFor production and staging deployments, continue to use the standard compose.yml file:
docker compose up -dThis runs all components (bot, server, and redis) in Docker containers.
To run tests, run python test.py.