ChatOps as a Service
CopyRight 2022 TechProber. All rights reserved.
Maintainer: Kevin Yu (@yqlbu)
The telegram-webhook-forwarder-bot forwards any incoming webhooks to the target telegram chat.
The bot is written in Python with Web Server Gateway Interface (WSGI) and Flask
Install depedencies
./installConfigure Environment with .env
# .env
API_TOKEN=
CHAT_ID=
WEBHOOK_PATH=
PORT=
Notes:
API_TOKENcan be obtained by BotFatherCHAT_IDcan be obtained by sharing the chat to the IDBotWEBHOOK_PATHis the api endpoint as part of the webhook url. e.g./webhook/helloPORTis the port that the server listens to when running the bot locally
Activate the virtual environment
# bash
. ./venv/bin/activate
# fish
. ./venv/bin/activate.fishSpin up the local server for debugging
python3 server.pyThis bot can be hosted as a serverless function. e.g hosted on Vercel
# install vercel client (cli)
npm -g install vercel
# login and authenticate
verlcel
# publish a new deployment and automatically promote it to production
vercel --prod