# telebot 🤖✨
Telegram Bot for our GitHub community 🤗
telebot is a bot that sends each one of the GitHub Webhooks we care about to our private Telegram group.
Besides that, it's an example of a Go project that uses GitHub Webhooks and the Telegram API.
This started as a go practice by @sadasant, but now it is the official Telegram bot for BerserkTech.
My study notes can be found: here.
This bot is currently listening to the following webhook events (keep in mind that some line breaks won't appear in this table):
We should definitely add more and improve what we're currently doing with each one of these events (check out the open issues!).
Some of the events are filtered. In detail:
status
if they have state equal to pending
.labeled
, unlabeled
, assigned
, unassigned
,
review_requested
, review_request_removed
, edited
or synchronize
Make sure you have Go installed: https://golang.org/doc/install. You can also use @stefanmaric's Simple go version manager, gluten-free 🙌
Make an issue or a pull request! :) Remember to fmt
your .go
s 😆
Execute the following command: go test ./...
We have a simple bash script called fmt-check.bash
. It runs go fmt -l .
at the root and in all the submodules of this repo. If it finds files
that don't have the proper formatting, it will exit with status code 1.
We use this script mainly for CI purposes.
Go to https://telegram.me/botfather and follow the steps :)
Make sure to store the HTTP API token in a safe place!
Make sure you have git installed. Follow the GitHub guides: https://help.github.com/en#dotcom, they're way better than anything I can come up with.
Once you have git
, you can clone this repo with:
git clone https://github.com/berserktech/telebot
or:
git clone git@github.com:berserktech/telebot.git
Install Zeit's now
by going to: https://zeit.co/download#now-cli,
or running npm install -g now
.
After you have now
, you'll need to add the following secrets:
telebot
doesn't
listen to telegram incoming messages, so you will need to follow the
steps described here: https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-idAt the end, if you run now secret ls
, it should look like this:
now secret ls
> 4 secrets found under sadasant [345ms]
name created
github-secret 9h ago
telegram-chat-id 8h ago
telegram-token 8h ago
As long as you have this project locally, you can run now
at the
root of telebot
to deploy it in with Zeit 👍 If you run it, you
should eventually get this output:
now
> Deploying ~/code/github.com/berserktech/telebot under sadasant
> Using project telebot
> Synced 2 files (6.91KB) [1s]
> https://telebot-[something random].now.sh [v2] [3s]
┌ index.go Ready [42s]
└── λ index.go (4.68MB) [iad1]
> Success! Deployment ready [45s]
At this point, you should be able to make network requests against it,
or to see the logs: now logs https://telebot-[something random].now.sh
.
New GitHub App
.https://telebot-[something random].now.sh
.github-secret
secret.MIT, check the LICENSE file.