A simple Telegram bot that responds to the /check command with a string of dots.
- Install dependencies:
pip install -r requirements.txt-
Get a Telegram bot token:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the instructions - Copy the bot token you receive
-
Set the bot token. You can use either method:
Option A: Using a .env file (recommended)
# Create a .env file in the project directory echo "TELEGRAM_BOT_TOKEN=your_token_here" > .env echo "WHITELISTED_USER_IDS=123456789,987654321" >> .env
Option B: Using environment variable
export TELEGRAM_BOT_TOKEN='your_token_here' export WHITELISTED_USER_IDS='123456789,987654321'
Note: The
WHITELISTED_USER_IDSis optional. If not set, all users can use the bot. If set, only the specified user IDs (comma-separated) will be able to use the bot. You can get a user's ID by having them send/startto the bot. -
Run the bot:
python bot.pyOnce the bot is running, send /check to any chat where the bot is present, and it will reply with a string of dots.