Example of a Telegram bot made on top of Serverless framework for AWS Lambda.
Just send a message to @serverless_example_bot
- Create a Telegram Bot.
- Install Serverless framework
- Create a Serverless project
- Clone this component repo inside the project's root directory
- Run
npm install
in the component directory - Add
TELEGRAM_TOKEN=XXX
andWEBHOOK_URL=https://ENDPOINT/bot/process
to.env
file
- Set the env vars:
serverless env set -k TELEGRAM_TOKEN -v XXXX
serverless env set -k WEBHOOK_URL -v "https://ENDPOINT/bot/process"
- Run
serverless dash deploy
to deploy your bot's functions - Run
setup
function (openhttps://ENDPOINT/bot/setup
) - Enjoy your serverless telegram bot!