Skip to content

Commit

Permalink
Merge pull request #120 from lorcalhost/documentation/custom-scripts
Browse files Browse the repository at this point in the history
Better custom scripts documentation
  • Loading branch information
lorcalhost authored Jul 21, 2021
2 parents 1e9ee1c + d271e8d commit c0f71c5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ You can also add the bot to a group if multiple people need to access this bot.

## Support the project

I am currently a broke university student, if you like my work and use it on a daily basis consider supporting the project through a small donation. :smile:
If you like `BTB-manager-telegram` and use it on a daily basis consider supporting the project through a small donation. :smile:

[:heart: Sponsor on GitHub](https://github.com/sponsors/lorcalhost)

Expand Down
Empty file added custom_scripts/.gitkeep
Empty file.
38 changes: 37 additions & 1 deletion docs/custom-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,47 @@ For example if one wants a button called `List files` which executes the `ls -la
}
```

Multiple scripts can be setup by adding a new line to the json file like so:
Multiple scripts can be setup by adding a new line to the json file like so (note the `,` when adding a new line):

```json
{
"List files": "ls -la -R",
"List files 2": "ls -la -R"
}
```

## Further information

By default, all scripts are executed from within `BTB-manager-telegram`'s directory.

It is recommended to use the `custom_scripts` directory in order to avoid confusion:

```bash
cd /path/to/the/BTB-manager-telegram/custom_scripts
```

## Example custom script installation

Create a script in a file called `custom_progress.sh` inside the `custom_scripts` directory, you can use this [example script](https://discord.com/channels/811277527997087745/818862057704390700/851190591454314539) from our Discord server.

Make the script executable by giving execute permissions:

```bash
chmod +x custom_progress.sh
```

In our example, the script uses `sqlite3`, so it is necessary to install it via system package manager:

```bash
sudo apt install sqlite3
```

Now we need to modify `custom_scripts.json` (it is located at `~/BTB-manager-telegram/config/custom_scripts.json`):

```json
{
"Custom Progress": "custom_scripts/custom_progress.sh"
}
```

Do not forget to restart `BTB-manager-telegram` bot so the changes will be applied.
2 changes: 1 addition & 1 deletion docs/telegram-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ urls:
```
Note:
_Binance Trade Bot Manager Telegram_ you can also decide to put a group chat id instead of a personal `chat_id`.
_Binance Trade Bot Manager Telegram_ also supports usage of a group chat id instead of a personal `chat_id`.

[@botfather]: https://t.me/botfather
[@userinfobot]: https://t.me/userinfobot

0 comments on commit c0f71c5

Please sign in to comment.