Deploy instructions:

  1. Make sure you have gcloud command installed.
  2. Create service account.
  3. Download it's key in JSON format.
  4. export GOOGLE_APPLICATION_CREDENTIALS="<path to JSON key of service account>"
  5. Create prod.env with content:
PROJECT_ID=<Google project id>
TELEGRAM_API_KEY=<token generated by BotFather>
EXCLUDE_LOG_TIME=True
TELEGRAM_WEBHOOK_TOKEN=<Generate token>
ADMIN_CHAT_ID=<feedback will come to this chat in tg>

Snippet to generate token

import random, string; print(''.join(random.choices(string.ascii_letters+string.digits, k=40)))
  1. Install gettext to have envsubst command
  2. Run deploy.sh
  3. Derive your app url. Example via console: gcloud app describe --format=json | jq -r '.defaultHostname'
  4. Register webhook:
curl -X POST -H "Content-Type: application/json" -d '{"url": "<appurl>/tg/{TELEGRAM_WEBHOOK_TOKEN}", "max_connections": 3, "allowed_updates": [“message”]}' 'https://api.telegram.org/bot{TELEGRAM_API_KEY}/setWebhook'