Compare commits
1 commit
e747b17141
...
c59eec9c50
Author | SHA1 | Date | |
---|---|---|---|
c59eec9c50 |
1 changed files with 19 additions and 11 deletions
30
README.md
30
README.md
|
@ -5,7 +5,7 @@
|
|||
1. Get a bot token ( [BotFather](https://telegram.me/botfather) )
|
||||
2. `$ npm install -g node-telme`
|
||||
3. `$ telme --init`
|
||||
4. Do something :)
|
||||
4. Need help? `$ telme --help`
|
||||
|
||||
## How do i get a bot token?
|
||||
- Get a telegram bot token from the botFather
|
||||
|
@ -13,35 +13,43 @@
|
|||
|
||||
## Configure `telme`
|
||||
|
||||
Simply run `$ telme --init` and follow the easy steps. You will need the bot token at this stage.
|
||||
Simply run `$ telme --init` and follow 2 easy steps. You will need the bot token at this stage.
|
||||
This will help you generate a `.telmeconfig` file in your home directory. You can always run `--init` again to override values or just edit the file yourself.
|
||||
|
||||
## Profiles
|
||||
|
||||
You can set multiple profiles, that will target different bots and/or different chats.
|
||||
> You can use the same bot in all profiles if you like. But the target chat can be different
|
||||
> You can use the same bot in all profiles if you like, But the target chat can be different
|
||||
|
||||
To initialize a new profile:
|
||||
```
|
||||
```shell
|
||||
$ telme --init --profile <profile_name>
|
||||
```
|
||||
|
||||
## Examples:
|
||||
###### Simple message
|
||||
```
|
||||
```shell
|
||||
$ telme --m "Message to send"
|
||||
```
|
||||
|
||||
In the next example a message will be sent every time the user `user` logs in to a tty.
|
||||
> Added the next lines at the bottom of `~/.profile` file
|
||||
```shell
|
||||
# Telme on login
|
||||
telme --m "A new Login:\n\`\`\` user: $(whoami) | hostname: $(hostname) | remote ip $(who | cut -d'(' -f2 | cut -d')' -f1)\`\`\` Hope this is you!"
|
||||
```
|
||||
|
||||
###### Task message
|
||||
Task messages are a simple way to receive a message from your bot once a command has been finished. It will also let you know if you had any errors.
|
||||
```
|
||||
```shell
|
||||
$ telme docker build . -t my-image/build/that/takes/for/ever
|
||||
```
|
||||
In this example, once the docker build has finished you will receive a message.
|
||||
|
||||
```
|
||||
$ telme npm run test
|
||||
```
|
||||
As mentioned before - you can also specify a profile.
|
||||
|
||||
```shell
|
||||
$ telme -p movie-club curl https://example.com/large/file/download.mp4
|
||||
```
|
||||
$ telme do-a-long-task
|
||||
```
|
||||
this will send the message to the `movie-club` profile chat. (By the `movie-club` bot)
|
||||
|
||||
|
|
Reference in a new issue