Skip to content
/ bellbot Public

Telegram bot that notifies you when commands finish executing

Notifications You must be signed in to change notification settings

Jongy/bellbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

bellbot

We all know that "compile" time can be used for fun purposes:

https://imgs.xkcd.com/comics/compiling.png

Sometimes, however, you'd like to actually go and do something else while your code is compiling...

Like terminal bells, often used to notify when commands complete executing: bellbot notifies you using Telegram, to your phone!

bellbot.jpg

Usage

  1. Create a bot and write down your token.
  2. Start a chat with your bot (you can find it in the search after it is created)
  3. Get your chat ID using python-telegram-bot as mentioned here, or if you're lazy use the following: curl https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates | python -c 'import json, sys; print(json.load(sys.stdin)["result"][0]["message"]["from"]["id"])'.
  4. echo YOUR_TOKEN > ~/.config/bellbot; echo CHAT_ID >> ~/.config/bellbot.
  5. cp bellbot.py ~/bin/bellbot or any other directory in your PATH.

To test it, run run bellbot sleep 2 and you should get a message within a few seconds.

To make the file fully self-contained, you can store the token and chat ID in globals like this:

$ echo 'TOKEN = "YOUR_TOKEN"' >> bellbot.py
$ echo 'CHAT_ID = "CHAT_ID"' >> bellbot.py

The script will use those variables, if found.

About

Telegram bot that notifies you when commands finish executing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages