From fce0d9ece1b141c9b08c0cbd6a266d87e9178e83 Mon Sep 17 00:00:00 2001 From: lorcalhost Date: Mon, 14 Jun 2021 11:14:06 +0200 Subject: [PATCH 1/2] Better custom scripts documentation --- docs/custom-scripts.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/custom-scripts.md b/docs/custom-scripts.md index e3fe0848..61a00eb2 100644 --- a/docs/custom-scripts.md +++ b/docs/custom-scripts.md @@ -27,3 +27,41 @@ Multiple scripts can be setup by adding a new line to the json file like so: "List files 2": "ls -la -R" } ``` + +## Further information + +By default, all scripts are executed from `BTB-manager-telegram`'s directory. + +It is recommended to create a `custom_scripts` directory in order to avoid confusion: + +```bash +cd /path/to/the/BTB-manager-telegram +mkdir custom_scripts +cd 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. From d271e8d850da2c53f4bc8d0e276642c44b7b382b Mon Sep 17 00:00:00 2001 From: lorcalhost Date: Wed, 21 Jul 2021 16:28:32 +0200 Subject: [PATCH 2/2] Update documentation, add custom_scripts dir --- README.md | 2 +- custom_scripts/.gitkeep | 0 docs/custom-scripts.md | 12 +++++------- docs/telegram-setup.md | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 custom_scripts/.gitkeep diff --git a/README.md b/README.md index f3030bfb..bc91bcd2 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/custom_scripts/.gitkeep b/custom_scripts/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/custom-scripts.md b/docs/custom-scripts.md index 61a00eb2..d9029ad6 100644 --- a/docs/custom-scripts.md +++ b/docs/custom-scripts.md @@ -19,7 +19,7 @@ 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 { @@ -30,14 +30,12 @@ Multiple scripts can be setup by adding a new line to the json file like so: ## Further information -By default, all scripts are executed from `BTB-manager-telegram`'s directory. +By default, all scripts are executed from within `BTB-manager-telegram`'s directory. -It is recommended to create a `custom_scripts` directory in order to avoid confusion: +It is recommended to use the `custom_scripts` directory in order to avoid confusion: ```bash -cd /path/to/the/BTB-manager-telegram -mkdir custom_scripts -cd custom_scripts +cd /path/to/the/BTB-manager-telegram/custom_scripts ``` ## Example custom script installation @@ -50,7 +48,7 @@ Make the script executable by giving execute permissions: chmod +x custom_progress.sh ``` -In our example, the script uses sqlite3, so it is necessary to install it via system package manager: +In our example, the script uses `sqlite3`, so it is necessary to install it via system package manager: ```bash sudo apt install sqlite3 diff --git a/docs/telegram-setup.md b/docs/telegram-setup.md index 8044d71c..737f1f0e 100644 --- a/docs/telegram-setup.md +++ b/docs/telegram-setup.md @@ -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