This bot offers several different Telegram games.
Try the games in your web browser here.
- HTML5 game served via Flask
- Telegram bot integration using
python-telegram-bot - Easy deployment with HTTPS (use ngrok or host on your server)
- Extensible for score tracking, leaderboards, etc.
- Support for leaderboards and high score tracking within Telegram
- Python 3.8+
- Telegram Bot Token from @BotFather
- Two games registered with a short name via
/setgame
-
Clone the repository
git clone https://github.com/Scusemua/Telegram-Arcade-Game-Bot.git cd Telegram-Arcade-Game-Bot -
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install . -
Configuration (environmente variables) Create a .env file in the root directory with the following required environment variable:
TELEGRAM_BOT_TOKEN="<your_bot_token_here>" GAME_URL="<base domain or IP address>"
The
TELEGRAM_BOT_TOKENis used to specify the Telegram Bot Token for the bot.Note: these arguments can also be passed as command line arguments. For a description of the available command line arguments, execute the following:
python -m telegram_color_clicker_game_bot --help
Start the bot with:
python -m telegram_color_clicker_game_bot --run-http-server MIT License. Free to use, modify, and share.
As of right now, there are two games offered by the Telegram Arcade Bot.
A simple Telegram-compatible HTML5 game where users must quickly click the rectangle that is correctly labeled with its color. Built using Python, Flask, and the Telegram Bot API.
- Two colored rectangles are shown.
- One is labeled correctly; the other is not.
- Click the correct one before time runs out to score a point!
- A wrong click or timeout ends the game.
You are shown a string of characters. You must quickly type an English word that contains those characters before the timer expires.
- Given a sequence of letters, enter an English word containing those letters
- You cannot re-use the same word multiple times (even for different sequences of characters)
- You are awarded additional time for each correct word
- You can increase the amount of time you are awarded by:
- Increasing your streak (i.e., the number of consecutive, valid submissions)
- Submitting longer words
- Surviving longer (the more correct submissions, the more time you get back -- and the faster the timer decreases)
speed.words.demo.mp4
- Two colored rectangles are shown.
- One is labeled correctly; the other is not.
- Click the correct one before time runs out to score a point!
- A wrong click or timeout ends the game.