Hackathonish version of the Telegram notifications bot for CodebaseHQ
I'm in no way a PHP programmer, but this bot works quite well in Telecan company. It also has no reason to be opensource, but why the hell not.
This bot sends you notifications regarding your assigned projects.
Currently available events (pretty much everything you can get from CodebaseHQ):
- Ticket creation and update
- Repo push
- Exception raised
- Deploy.hq deployment
/tickets
project_name [search_options]
project_name
: fuzzy search for match in project name or permalinksearch_options
: quick search options from CodebaseHQ (optional, though, recommended)
/my_tickets
[project_name search_options]
project_name
andsearch_options
are optional
You may use shortcuts: \t
and \mt
respectively.
CodebaseHQ search parameters: https://support.codebasehq.com/articles/tickets/quick-search
/help
- The bot highlights messages requiring your attention with
‼️ - It gives you direct links to anything useful regarding the event
- Messages contain #hashtags for easy navigation and grouping
- You can forward a ticket you've just created to the assignee to get his attention (currently, you're notified of your own actions, too. You can switch it off... somewhere in the
TelegramSubscriptionsHandler
)
- Copy config files from
config_sample/
toconfig/
and set them up accordingly.
-
You can find your CodebaseHQ API credentials in your profile:
https://{PROJECT_NAME}.codebasehq.com/settings/profile
, then setupconfig/codebasehq.php
-
You'll need to create a Telegram Bot using @BotFather and setup
config/telegram.php
-
Also, your domain should have a valid SSL certificate for Telegram bot API to work. You can get a free one here: https://letsencrypt.org
-
Setup Telegram bot hook using
telegram_hook_set.php
. You can unset it withtelegram_hook_unset.php
-
Setup event hooks on CodebaseHQ:
https://{PROJECT_NAME}.codebasehq.com/settings/event_hooks
- All actions, HTTP Post to
https://{BOT_URL}/hook_codebasehq.php
-
Call
codebasehq_update_projects.php
periodically to update users, projects and assignments. -
Register in your bot (
/start
it and it'll guide you and your users through the process). -
Manually assign
codebasehq_user_id
intelegram_users
table or register using your CodebaseHQ API key via bot dialog.
- PHP7
- SSL for your bot domain
- MySQL or MariaDB
Fast & dirty
- configure everything in
config/
- open
https://{BOT_URL}/install.php
or just runinstall.php
Optionally, you can setup Vscale account status notifications in config/vscale.php
and call hook_vscale.php
with CRON (see config_sample/cron.txt
)
- Register CodebaseHQ account automatically with API-key
- Installer
- Add bot to groups
- Configure which notifications the user would like to receive