A simple program that send message with telegram bot API
This project provide two executable and one sample env file
tgbot-msg: go binary, simply send message to telegram use 'TGBOT_MSG_TOKEN' and 'TGBOT_MSG_CHATID' env var
process-notify: bash script that wrap other command, and notify through tgbot-msg after command finished.
Follow the tutorial to get your token and chat ID
- From BotFather to 'Hello World'
- Introduction to the API · python-telegram-bot/python-telegram-bot Wiki
tgbot-msg_Linux_x86_64/
├── bin/
│ ├── process-notify*
│ └── tgbot-msg*
└── tgbot.env
- move two binaries into PATH
- move tgbot.env to ~/.tgbot.env
put process-notify before the command that you want to monitor
process-notify sleep 3you will receive the message
host: machine
PWD: /home/foo/bar
$ sleep 3
ret = 0, take 00:00:03
if the command fail,
process-notify falseyou will receive the message
host: machine
PWD: /home/foo/bar
$ false
ret = 1, take 00:00:00
Change process-notify to custom the message format you want