Receive GitHub webhook events and send to Telegram chats with AIOHTTP through Telegram Bot API

Overview

GitHub Webhook to Telegram

Receive GitHub webhook events and send to Telegram chats with AIOHTTP through Telegram Bot API

What this project do is very simple, it does not use any Telegram Bot API framework/library nor receive updates from Telegram, but calling sendMessage method of Telegram Bot API directly by sending GET requests through AIOHTTP. It should be able to be used along with any existing Telegram bot without conflicts.

  1. Receive GitHub webhooks (POST request)
  2. Verify the SHA256 signature
  3. Format and send the text to a Telegram chat through "sendMessage" method of Telegram Bot API (GET request)

Heroku

Deploy

Setup

You need a Telegram bot token, create a Telegram bot with BotFather if you don't have one yet.

Configuration

  1. Go to your GitHub project Settings - Webhooks - Add webhook, fill "Payload URL", "Content Type" (must be application/json) and "Secret". You can also do this after start running the project.
  2. Copy config_sample.json to config.json to configure it. chat_id can be user id or group/channel id/username, make sure the bot is /started or member of the chat with permission to send messages
  3. Configure reverse proxy for this app, corresponding configuration for Nginx looks like this
    location /github {
        rewrite ^/github(.*) /$1 break;
        proxy_pass http://127.0.0.1:12345;
    }
    

Run

virtualenv venv
venv/bin/pip install -U -r requirements.txt
venv/bin/python main.py

LICENSE

AGPL-3.0-or-later


    github-webhook-to-telegram, receive GitHub webhooks and send to Telegram
    Copyright (C) 2021  Dash Eclipse

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

You might also like...
A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats

TG-MusicPlayer A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requirements Py

A Telegram Bot to Play Audio in Voice Chats With Youtube and Deezer support. Supports Live streaming from youtube Supports Mega Radio Fm Streamings

Bot To Stream Musics on PyTGcalls with Channel Support. A Telegram Bot to Play Audio in Voice Chats With Supports Live streaming from youtube and Mega

This bot can stream audio or video files and urls in telegram voice chats :)

Voice Chat Streamer This bot can stream audio or video files and urls in telegram voice chats :) 🎯 Follow me and star this repo for more telegram bot

🎡 RythmReloaded 🎡 A bot that can play music on Telegram Group and Channel Voice Chats
🎡 RythmReloaded 🎡 A bot that can play music on Telegram Group and Channel Voice Chats

🎡 RythmReloaded 🎡 A bot that can play music on Telegram Group and Channel Voice Chats POWERED BY MARSHALX TGCALLS Available on telegram as @OptimusP

This Is Advanced Version Of Old Radio Player, An Telegram Bot to Play Radio/Music in Channel or Group Voice Chats.

Telegram Radio Player V2 An Telegram Bot to Play Radio/Music in Channel or Group Voice Chats. This is also the source code of the bot which is being u

 A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.
A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.

TgTwitterStreamer A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat. For Getting ENV's Refer this Link

This Telegram bot allows you to create direct links with pre-filled text to WhatsApp Chats

WhatsApp API Bot Telegram bot to create direct links with pre-filled text for WhatsApp Chats You can check our bot here. The bot is based on the API p

Bot-moderator for Telegram group chats
Bot-moderator for Telegram group chats

Project title A little info about your project and/ or overview that explains what the project is about. 🌟 Hello everyone! This is the repository of

A bot that can play songs in Telegram group voice chats like AK 47

🎧 47Music Player 🎧 A bot that can play songs in Telegram group voice chats like AK 47 ✨ Easy To Deploy Pyrogram Session Config Vars API_ID : Assista

Comments
  • RuntimeError: Timeout context manager should be used inside a task

    RuntimeError: Timeout context manager should be used inside a task

    2022-06-15T03:42:11.794121+00:00 app[web.1]:   File "/app/utils/telegram.py", line 54, in send_message
    2022-06-15T03:42:11.794121+00:00 app[web.1]:     async with session.post(api_url,
    2022-06-15T03:42:11.794122+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    2022-06-15T03:42:11.794122+00:00 app[web.1]:     self._resp = await self._coro
    2022-06-15T03:42:11.794122+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/aiohttp/client.py", line 466, in _request
    2022-06-15T03:42:11.794123+00:00 app[web.1]:     with timer:
    2022-06-15T03:42:11.794123+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.9/site-packages/aiohttp/helpers.py", line 701, in __enter__
    2022-06-15T03:42:11.794124+00:00 app[web.1]:     raise RuntimeError(
    2022-06-15T03:42:11.794124+00:00 app[web.1]: RuntimeError: Timeout context manager should be used inside a task
    2022-06-15T03:42:11.796452+00:00 heroku[router]: at=info method=POST path="/" host=****.herokuapp.com request_id=*** fwd="***" dyno=*** connect=0ms service=2ms status=500 bytes=244 protocol=https
    
    opened by littlecxm 0
A simple python bot that serves to send some notifications about GitHub events to Slack.

github alerts slack bot ?? What is it? ?? This is a simple bot that serves to send some notifications about GitHub events to Slack channels. These are

Jackson Alves 10 Dec 10, 2022
Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API.

Tg_PHub_Bot Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API. OS Support All linu

TheProgrammerCat 13 Oct 21, 2022
Using GNU Radio and HackRF One to Receive, Analyze and Send ASK/OOK signals

play_with_ask NIS-8016 Lab A code: Recv.grc/py: Receive signals and match with ASK button using HackRF and GNU radio. I use AM demod block(can also in

Chen Anxue 1 Jul 4, 2022
A management system designed for the employees of MIRAS (Art Gallery). It is used to sell/cancel tickets, book/cancel events and keeps track of all upcoming events.

Art-Galleria-Management-System Its a management system designed for the employees of MIRAS (Art Gallery). Backend : Python Frontend : Django Database

Areesha Tahir 8 Nov 30, 2022
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
The worst but simplest webhook bot for GitHub and Matrix.

gh-bot gh-bot is maybe the worst (but simplest) Matrix webhook bot for Github. Example of commits: Example of workflow finished: Setting up Server You

Jae Lo Presti 4 Aug 18, 2022
πŸš€ An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
send sms via grafana alert webhook

notifier fire alarm What does this project do: the aim of this project is to send alarm notification from grafana alert manager via kavenegar api. sta

Ali Soltani 4 Oct 20, 2021
A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats.

Vcmusic-Userbot A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram R

null 3 Oct 23, 2021
A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats.

VC UserBot A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requirements Python

쑰던 1 Nov 29, 2021