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
./install
Configure Environment with .env
# .env
API_TOKEN=
CHAT_ID=
WEBHOOK_PATH=
PORT=
Notes:
API_TOKEN
can be obtained by BotFatherCHAT_ID
can be obtained by sharing the chat to the IDBotWEBHOOK_PATH
is the api endpoint as part of the webhook url. e.g./webhook/hello
PORT
is the port that the server listens to when running the bot locally
Activate the virtual environment
# bash
. ./venv/bin/activate
# fish
. ./venv/bin/activate.fish
Spin up the local server for debugging
python3 server.py
This 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