Skip to content

Commit

Permalink
Format readme, fix minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Wint3rmute committed Aug 26, 2023
1 parent 44b3842 commit 439fe54
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@

## Usage

`$ some_command | tnb` - will send the output of the command to your [Telegram](https://telegram.org/) conversation of choice.
`$ some_command | tnb` - will send the output of the command to your
[Telegram](https://telegram.org/) conversation of choice.

Useful for streaming the output of long-running commands, when you don't want/can't keep a constant SSH connection or you
only need a notification when something finishes.
Useful for streaming the output of long-running commands, when you don't
want/can't keep a constant SSH connection or you only need a notification when
something finishes.


## Installation

### Arch/Manjaro
`tnb` package on the AUR.
### Arch-based distros

[`tnb`](https://aur.archlinux.org/packages/tnb) package on the AUR.

### Others
`cargo build --release`, then copy the resulting binary (at `./target/release/tnb`) to some folder in your PATH.

Run `cargo build --release`, then copy the resulting binary (at
`./target/release/tnb`) to some folder in your PATH.

## Configuration

Expand All @@ -29,18 +33,23 @@ $ tnb
Creating a new config file at /home/wint3rmute/.config/tnb.json
```

You'll have to fill the `token` and `chat_id` fields in the configuration file for your bot to work.
You'll have to fill the `token` and `chat_id` fields in the configuration file
for your bot to work.

### Bot token

Text [BotFather](https://telegram.me/botfather) on Telegram in order to create a bot and obtain a bot token.
Text [BotFather](https://telegram.me/botfather) on Telegram in order to create
a bot and obtain a bot token.

### Chat ID

Once you've obtained the bot token, you can check the Chat ID by sending a message to your bot and then
opening `https://api.telegram.org/bot<BOT_TOKEN_HERE>/getUpdates?offset=-1` in your browser.
Once you've obtained the bot token, you can check the Chat ID by sending a
message to your bot and then opening
`https://api.telegram.org/bot<BOT_TOKEN_HERE>/getUpdates?offset=-1` in your
browser.

![](docs/chat_id.jpg)

*Note:* You can either text a bot directly or add it into a conversation/group.
Refer to [Telegram Bot API](https://core.telegram.org/bots/api) for more information
Refer to [Telegram Bot API](https://core.telegram.org/bots/api) for more
information.

0 comments on commit 439fe54

Please sign in to comment.