Simple echo Telegram bot example on aiogram framework using AWS API Gateway & Lambda.
- Clone this repository:
git clone https://github.com/DavisDmitry/aiogram-aws-serverless-example.git
- Change to the directory with the repository copy:
cd aiogram-aws-serverless-example
- Run create-package bash script:
./create-package.sh
- Create a new bot at botfather
- Create AWS Lambda function, set environment variables and deploy package:
TOKEN
: Bot API token from botfatherLOGGING_LEVEL
: logging level (optional), default -info
- Create and configure API Gateway entrypoint:
- Set webhook for your bot: follow the link through your browser or using curl –
https://api.telegram.org/bot{your_bot_api_token}/setWebhook?url={your_api_gateway_url}