https://github.com/txchen/teleme
simple cli tool that sends message as telegram bot
https://github.com/txchen/teleme
Last synced: 18 days ago
JSON representation
simple cli tool that sends message as telegram bot
- Host: GitHub
- URL: https://github.com/txchen/teleme
- Owner: txchen
- License: mit
- Created: 2018-05-25T05:44:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T04:05:24.000Z (almost 6 years ago)
- Last Synced: 2026-05-14T09:41:36.626Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/teleme
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# teleme
> simple cli tool that sends message as telegram bot
Can be useful when you run long duration cli tasks.
## Install
```bash
$ npm install --global teleme
```
## Setup
Firstly, you need to create a telegram bot via @botfather, get the bot's token, and the chatid.
The chat can be a group or 1-1 conversation.
Then, put the information into `~/.config/teleme/config.json`, such as:
```json
{
"token": "TOKEN_OF_THE_BOT",
"chatid": "12345678",
"bot2_token": "TOKEN_OF_ANOTHER_BOT", # optional
"bot2_chatid": "23456789", # optional
}
```
Execute `teleme` and you should be able to receive a message from the bot, that's it.
If you need to use it for root user, don't forget to set the config for root as well.
## Usage
```
$ teleme --help
Usage
$ tlm
OR
$ teleme
OR if you want to use the non-default bot
$ TLMBOT=bot2 teleme
If you want to send silent message
$ SILENT=true teleme
Examples
$ teleme
$ tlm
$ teleme "My sexy message ❤️ "
```
The usage can be flexible, for example:
* After you realize the command is slow, just enter `tlm` or `teleme`.
```
$ some-slow-cmd
output1
output2
...
tlm
```
* You know the command will take a long time
```
$ some-heavy-task ; teleme
```
* Only let me know if there is something wrong
```
$ cmd-that-should-not-fail || teleme 'something weird just happened'
```
## License
MIT © [Tianxiang Chen](https://github.com/txchen)