Testing on your Local Machine
NOTE: Following environment variables are used to configure the bot in PRODUCTION/LOCAL ENVIRONMENT
.
TELEGRAM_TOKEN
-> Telegram bot token.DEV_CHAT_ID
-> The chat id of the developer where the bot will send debug messages.GROUP_CHAT_ID
-> The chat id of your group.SECRET_KEY
-> The secret key for the file decryption process (You can find your key insideDATA
directory).
You can set these environment variables in your terminal using the following commands:
export DEV_CHAT_ID=use_your_chat_id_here_obtained_from_idbot
export TELEGRAM_TOKEN=use_your_telegram_token_obtained_from_botfather_earlier
export SECRET_KEY=use_your_secret_key_here_obtained_from_encrypting_data
export GROUP_CHAT_ID=use_your_group_chat_id_here_obtained_from_idbotRun the bot using the following command:
On Linux:
python3 bla_bot.py
On Windows:
py bla_bot.py
On Linux using Poetry:
poetry run python3 bla_bot.py
Cool! Now you can start using your bot.
Open the Telegram app and search for your bot and start a conversation with it. Send/help
to your bot to see the list of commands. Test all other features and make sure everything is working as expected.Press
Ctrl-C
on the command line to stop the bot.