A Discord bot that runs a Bomb Party–style word game in a designated channel. Players join a lobby, then compete across multiple rounds by submitting English words that contain a displayed letter sequence.
- Built with discord.py 2.4.0
- Uses a local JSON dictionary (
data/words.json) - Designed for one active session per channel
- Manual start with a join lobby (buttons + commands)
- Join/Leave UI buttons (Discord Views)
- Think phase: players type without sending (the bot deletes messages from joined players to keep secrecy)
- Send window: only the first message from each joined player counts
- Duplicate-word handling: if multiple players submit the same valid word, points are split evenly
- Configurable timings and round settings via
config/constants.py
Each round:
- Bot posts a sequence (e.g.
art) - Think phase begins (default: 8s)
- If players send messages early, the bot attempts to delete those messages (joined players only)
- Send phase begins (default: 3.5s)
- Players send one message; only the first word is used
- Bot validates:
- Word contains the sequence
- Word exists in the bot’s dictionary (with simple plural handling)
- Bot awards points and posts round results
At the end, the bot posts a leaderboard.
- Python 3.10+ (recommended;
zoneinfois in stdlib and discord.py supports 3.10+ well) - A Discord application + bot token
- Permissions to:
- Read/Send Messages
- Manage Messages (optional but strongly recommended for think-phase deletions)
- Embed Links
Dependencies are pinned in requirements.txt:
discord.py==2.4.0python-dotenv==1.0.1
In the Discord Developer Portal:
- Create an application
- Add a bot user
- Copy the bot token (keep it secret)
Enable Privileged Gateway Intents (very important):
- ✅ Message Content Intent (required to read answers)
- ✅ Server Members Intent (used by this bot)
The code sets:
intents.message_content = Trueintents.members = True
Copy .env.example to .env:
cp .env.example .envEdit .env:
DISCORD_BOT_TOKEN="your_token_here"
COMMAND_PREFIX=!The bot restricts commands to a single channel ID:
File: config/constants.py
BOMB_PARTY_CHANNEL_ID = 1424518289626894468Replace it with your channel’s ID:
- Enable Developer Mode in Discord
- Right-click the channel → Copy Channel ID
- Paste it into
BOMB_PARTY_CHANNEL_ID
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
pip install -r requirements.txt
python bot.pyAll commands must be used in the configured Bomb Party channel.
-
!bomb_party(or!bm)
Shows help. -
!bomb_party start
Opens a join lobby forJOIN_WINDOW_SECONDS(default: 30s).
The creator auto-joins. The game starts if at least 2 players joined. -
!bomb_party join
Joins the currently open lobby. -
!bomb_party leave
Leaves the currently open lobby.
You can also join/leave using the Join / Leave buttons on the lobby message.
File: config/constants.py
Key settings:
-
TIME_TO_ANSWER(default: 8)
Think phase length. -
SEND_WINDOW_SECONDS(default: 3.5)
How long players have to send after think ends. -
TIME_BETWEEN_QUESTIONS(default: 3)
Gap between rounds. -
ROUNDS_PER_GAME(default: 10) -
ROUND_POINTS(default: 100)
Points per valid word (split among duplicate submissions). -
JOIN_WINDOW_SECONDS(default: 30)
File: data/words.json is a JSON array of words.
The bot loads this file at startup via utils/dictionary.py.
Prompts are generated by selecting a random 3–5 letter word, then taking a random substring of length 3 by default.
You can tweak prompt length here:
get_random_prompt(length: int = 3)A submitted word is valid if:
- It contains the prompt sequence (substring check)
- It exists in the dictionary set, with light plural handling:
ies→yes→ removeds→ removed
If you want stricter or more expansive validation, update is_valid_english_word().
During the think phase, the bot tries to delete messages from joined players to discourage early sending.
To make this work reliably, give the bot:
- Manage Messages permission in the game channel
If not granted, the game still works, but players can leak answers by sending early and the bot may be unable to delete them.
The bot caps deletions at 20 per think phase (MAX_DELETES = 20).
MIT. See LICENSE.