A Telegram bot that provides boom counts and plays Craps.
/boom: Sends a random number (1-5) of 💥 emojis./boom <number>: Sends the specified number (1-5) of 💥 emojis./boom <number > 5>: Sends a sassy reply./boom <number < 1>: Sends a different sassy reply./boom <non-number>: Sends a sassy reply about needing a number./howmanybooms <question>: Asks the bot how many booms something deserves (e.g.,/howmanybooms does my cat deserve). The bot remembers questions and provides consistent (randomly assigned) answers using NLTK for fuzzy matching.- Sending a photo with
/howmanybooms <question>in the caption: Same as the text command, but triggered by a photo caption. - Craps Game (Multi-Channel & Multi-Player):
/roll: Rolls the dice for the current channel's Craps game. Resolves bets for all players in the channel./bet <type> <amount>: Places a bet for the user in the current channel. Valid types includepass_line,dont_pass,field,place_4,place_5,place_6,place_8,place_9,place_10. (e.g.,/bet pass_line 10,/bet place 6 12)./showgame: Displays the current channel's game state (Point, Phase) and the user's current balance and active bets./resetmygame: Resets the user's balance to the starting amount ($100) and clears their bets within the current channel./crapshelp: Shows detailed rules and commands for the Craps game.
-
Clone the repository (or download the files):
git clone <repository_url> # Or download ZIP cd boom-bot
-
Create a virtual environment (recommended):
python -m venv venv # On Windows .\venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
(Note: This will also download necessary NLTK data on first run if not present.)
-
Get a Telegram Bot Token:
- Talk to @BotFather on Telegram.
- Create a new bot using
/newbot. - Copy the token BotFather gives you.
-
Create a
.envfile:- Create a file named
.envin theboom-botdirectory. - Add the following line, replacing
YOUR_TOKEN_HEREwith the token you got from BotFather:
TELEGRAM_BOT_TOKEN=YOUR_TOKEN_HERE - Create a file named
-
Run the bot:
python bot.py
The bot should now be running and connected to Telegram.