This is a simple echo bot on Telegram. (NodeJS)
- Node.js
24.xor later - Telegram account
- AWS account
- Install serverless via npm
$ npm install -g serverless
- Create a bot from Telegram, sending this message to @BotFather
$ /newbot
- Put the token received into the
TELEGRAM_BOT_TOKENenvironment variable inserverless.yml.
provider:
environment:
TELEGRAM_BOT_TOKEN: YOUR_API_TOKEN_HERE- Deploy it!
$ serverless deploy
- Configure webhook
curl --request POST --url https://api.telegram.org/bot{token}/setWebhook --header 'content-type: application/json' --data '{"url": "{end-poinnt}"}'
Say hello to your bot 🤖