tgbot-msg

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 5 Imported by: 0

README

tgbot-msg

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

Installation

tgbot-msg_Linux_x86_64/
├── bin/
│  ├── process-notify*
│  └── tgbot-msg*
└── tgbot.env
  • move two binaries into PATH
  • move tgbot.env to ~/.tgbot.env

Usage

put process-notify before the command that you want to monitor

process-notify sleep 3

you will receive the message

host: machine
PWD: /home/foo/bar
$ sleep 3
ret = 0, take 00:00:03

if the command fail,

process-notify false

you 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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL