Announcement: Telegram added a feature to pin multi messages recently, deprecating the bot.
Manage a stack of pinned messages for Telegram groups.
This project involves AWS Lambda, AWS API Gateway as well as AWS DynamoDB, which all have "always free" tiers.
- Register a bot on Telegram. Now you have a token for the bot.
- Create an AWS Lambda function.
- Add an AWS API Gateway endpoint to this function. Now you have an endpoint address for your Lambda function.
- Create an AWS DynamoDB, and give full access of this to the role AWS just created for the Lambda function. You might need o add a policy to the role.
- Fill in the environment variables for the Lambda function:
AWS_DYNAMODB_NAME - Name of your DynamoDB
AWS_DYNAMODB_REGION - Region of your DynamoDB
TELEGRAM_TOKEN - Telegram bot token
npm install
serverless package
- Deploy the zip package in
.serverless/
to AWS Lambda. - Set the webhook of your bot at your API endpoint. You might need to visit
https://api.telegram.org/bot<YOUR TELEGRAM BOT TOKEN>/setWebhook?url=<YOUR API ENDPOINT>
. - Test if the bot is working.