Telegram bot
- Create
.env
file with the following entries:
BOT_TOKEN=<YOUR BOT TOKEN ID>
HELIX_PROVIDER=<YOUR HELIX PROVIDER>
- Put your AWS API credentials to
~/.aws/credentials
- Deploy AWS lambda function and connect to Gateway API as explained here
- For local testing put your test response for the Telegram API to
test-tg-message.json
and runlambda-local-test.js
- The messages will appear in your bot chat
-
set the environment variable
BOT_WEBHOOK
to bot's webhook (that is, your AWS Gateway endpoint, registered as described in Telegram docs) -
run
test_curl.sh
- Obtain
BOT_TOKEN
from the Bot Father as explained in API - Create AWS Gateway endpoint and integrate with AWS Lambda function as explained here
- Package the sources into a zip archive
zip -FSr deploy.zip *.js package-lock.json node_modules
- Update your AWS lambda function
aws lambda update-function-code --function-name <lambda-func-name> --zip-file fileb://deploy.zip
A more robust way to develop and deploy is by using serverless framework.