Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 944 Bytes

development.md

File metadata and controls

50 lines (37 loc) · 944 Bytes

Config

Copy config.dist.py -> config.py, edit

Deploy

export AWS_PROFILE=...
export TELEGRAM_TOKEN="..."
export WEBHOOK_PATH="..."
export SLS_STAGE=prod|dev
serverless deploy

You will get the endpoint url here. Use some secret stuff for the webhook path, for example, telegram token without the colon (not allowed in path)

Webhook setup

curl --request POST \
--url https://api.telegram.org/bot{TELEGRAM_TOKEN}/setWebhook \
--header 'content-type: application/json' \
--data '{"url": "{ENDPOINT_URL}"}'

On success, you will get:

{"ok":true,"result":true,"description":"Webhook was set"}

To remove webhook:

curl --request POST \
--url https://api.telegram.org/bot{TELEGRAM_TOKEN}/deleteWebhook

Something's wrong

See the webhook logs:

export AWS_PROFILE=...
export TELEGRAM_TOKEN="..."
export WEBHOOK_PATH="..."
export SLS_STAGE=prod|dev
serverless logs -t -f webhook