Example of serverless Telegram Bot with AWS Lambda. The choice of AWS Lambda was quite obvious - low expenses to run and maintain my application (on-demand usage).
What does the bot do? Nothing special, just random facts about Ferdinand Magellan in Russian. If you are curious you can try it out and write the message to https://t.me/CaptainMagellan_bot.
The repository has been created for educational purposes only.
- Copy the repository to your local machine:
git clone https://github.com/{{ username }}/Serverless-Telegram-Bot.git
- Go to the project directory:
cd Serverless-Telegram-Bot
- Create a virtual environment
python3 -m venv venv
- Activation of the virtual environment:
source venv/bin/activate
- Update pip to latest version:
pip install --upgrade pip
- Install requirements
pip install -r requirements.txt
- Then you will need to create your bot with BotFather. I found this link useful.
- After that, it is necessary to set up AWS Environment for your bot. A detailed description is provided here.
- When AWS environment is ready we can upload our package. I used the option with zip file upload.
- The last but not least step on our list is to create a webhook for our bot.
