A Telegram bot for word chain and word guessing games in group chats. Built with Python and Pyrogram.
- Classic word chain game with turn-based gameplay
- Word guessing game where users can host and guess
- Player statistics tracking
- 466,000+ word dictionary for validation
-
Clone the repository
git clone <repository-url> cd WordGameBot
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
export TOKEN="your_telegram_bot_token" export MONGO_URL="your_mongodb_connection_string" export API_HASH="your_telegram_api_hash" export API_ID="your_telegram_api_id"
-
Run the bot
python -m word
/startclassic
- Start a new classic word chain game/join
- Join a pending game/flee
- Leave a pending game/extend
- Extend game start countdown by 30 seconds/forcestart
- Force start the game (starter only)
/host
- Start hosting a word guessing game/stopgame
- Stop the current host game (host only)
/start
- Bot introduction and add to group/help
- Show help information/stats
- View your personal statistics
-
Starting a Game
- Use
/startclassic
in a group chat - Players join with
/join
command - Game starts automatically after 1 minute or use
/forcestart
- Use
-
Game Rules
- First word starts with a random letter
- Each subsequent word must start with the last letter of the previous word
- Minimum word length starts at 3 letters
- Each player has 45 seconds per turn
- Word length increases by 1 every 2 words
- Time limit decreases by 10 seconds every 4 words
-
Winning
- Last player remaining wins the game
- Players are eliminated if they run out of time
- Invalid words result in turn skipping
-
Hosting
- Use
/host
command to start hosting - Use inline buttons to see or change the word
- Players guess by typing words in chat
- Use
-
Guessing
- Simply type your guess in the group chat
- First correct guess wins the round
- Host cannot participate in guessing
The bot is ready for Heroku deployment with the included Procfile
:
git add .
git commit -m "Deploy WordGameBot"
git push heroku main
python -m word
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
This is an open source project and contributions are welcome! Feel free to fork, modify, and distribute according to the MIT License terms.
If you encounter any issues:
- Check existing issues on the repository
- Create a detailed bug report with steps to reproduce
- Include bot logs if possible
Add the bot to your group: @WordNWordRobot