From c2fe7bfa9aee61875c0b3688758f79bf2776fe90 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 20 Feb 2023 15:14:41 -0500 Subject: [PATCH] Documentation update --- README.md | 38 ++++++++++++-------------------- data/strings.json | 4 ++-- modules/_prepareStrings.js | 45 +++++++++++++++++--------------------- slash-commands/help.js | 2 +- 4 files changed, 37 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 85e2e8a..5871704 100755 --- a/README.md +++ b/README.md @@ -13,34 +13,24 @@ Silvanus is not affiliated with Grow A Tree or Limbo Labs. ## Setup -If your `/tree` and `/top trees` messages are in the same channel, simple run `/compare` in that channel and you're good to go! +If your `/tree` and `/top trees` messages are in the same channel, simply run `/compare` in that channel and you're good to go! -Otherwise, run `/setup` to set the proper channels for the bot to look in for the `/tree` and `/top trees` messages. +Otherwise, run `/setup compare` to set the proper channels for the bot to look in for the `/tree` and `/top trees` messages. Use `/commands` to view a description of all my commands. ## Permissions -Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. If you plan to use the Role Menu Silvanus will also need permission to `Manage Roles` +Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. If you plan to use the Role Menu Silvanus will also need permission to `Manage Roles`. ## Commands -* `/setup` - You only need to run this command if your server has its `/tree` and `/top trees` messages in separate channels. -* `/setupinfo` - Displays your server's configuration information. -* `/compare` - Sends a refreshable embed that calculcates the height difference between your tree and the trees currently displayed on your Tallest Trees message. There is also an Active Growth Indicator (`[💧]`). -* `/notifications` - Guild members with the `Manage Roles` permission can run this command to set up automatic reminders when your tree is ready to be watered or when fruit is dropping. - * This feature relies on Grow A Tree's built-in Notification system. Refer to Grow A Tree for instructions on setting them up. - * `watchchannel`: Select the channel you've configured Grow A Tree to send notifications in. - * `watermessage`: This option sets the message to send when the tree is ready to be watered. This can include `@pings`, links, etc. - * `pingchannel`: Select the channel you want Silvanus to forward the notifications to. - * `fruitmessage`: Optional: This sets the message to send when the tree is dropping fruit. If not set, the `watermessage` will be used instead. -* `/rolemenu` - Creates a menu for users to give themselves Water and Fruit pingable roles. - * Requires `Manage Roles` permission to run. - * `waterrole`: Select the role to give users when they select the Water button - * `fruitrole`: Optional: Select the role to give users when they select the Fruit button - * If this option isn't set, no Fruit Role will be available for self-assignment. -* `/watertime` - Calculates the wait time between waters for a tree of a given height. - * `height`: The height in feet to calculate for. -* `/timetoheight` - Calculates how long it would take to grow to a height - * `endheight`: The destination height, in feet. - * `beginheight`: Optional: The starting height, in feet. If this option isn't set, the current height of your tree will be used insead. -* `/reset` - Removes your server's configuration from the database. -* `/help` - Displays the bot's help page and links to each command. \ No newline at end of file +* `/compare` - Compare your tree to others on the leaderboard +* `/relay set` - Setup a Notification Relay for the first time +* `/relay update` - Update an already configured Notification Relay +* `/relay disable` - Disable the Notification Relay +* `/rolemenu` - Send a self-assignable role menu for relay pings +* `/watertime` - Calculates the time between waters for a tree of a given height +* `/timetoheight` - Calculates how long it would take a tree to grow to a given height +* `/setup compare` - Set the channels to use with `/compare` +* `/setup view` - View your server's configuration +* `/setup reset` - Delete your server's configuration +* `/help` - Displays the bot's help page \ No newline at end of file diff --git a/data/strings.json b/data/strings.json index 184e013..b59e3e8 100755 --- a/data/strings.json +++ b/data/strings.json @@ -5,9 +5,9 @@ "help": { "title": "Silvanus Help", "info": "Silvanus is the ultimate Grow A Tree companion bot! Quickly compare your server's tree to others on the leaderboard with automatic calculation of tree height differences, active growth detection, watering time calculations, and more!\n\nImportant Note: Silvanus is only as up-to-date as your server's newest Tree and Tallest Trees messages. Make sure to refresh them before refreshing Silvanus' Compare message.", - "setup": "If your ``/tree`` and ``/top trees`` messages are in the same channel, simple run in that channel and you're good to go!\n\nOtherwise, run to set the proper channels for the bot to look in for the ``/tree`` and ``/top trees`` messages.\n\nUse to view a description of all my commands.", + "setup": "If your and messages are in the same channel, simply run in that channel and you're good to go!\n\nOtherwise, run to set the proper channels for the bot to look in for the and messages.\n\nUse to view a description of all my commands.", "permissions": "At a minimum, Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. If Analyzer is given permission to `Manage Messages`, the bot will delete the `.settree` and `.setranks` messages to reduce spam.", - "allCommands": " - You only need to run this command if your server has its ``/tree`` and ``/top trees`` messages in separate channels.\n - Displays your server's configuration information.\n - Sends a refreshable embed that calculcates the height difference between your tree and the trees currently displayed on your Tallest Trees message. There is also an Active Growth Indicator (``[💧]``).\n - Guild members with the ``Manage Roles`` permission can run this command to set up automatic reminders when your tree is ready to be watered or when fruit is dropping.\n This feature relies on Grow A Tree's built-in Notification system. Refer to Grow A Tree for instructions on setting them up.\n ``watchchannel``: Select the channel you've configured Grow A Tree to send notifications in.\n ``watermessage``: This option sets the message to send when the tree is ready to be watered. This can include ``@pings``, links, etc.\n ``pingchannel``: Select the channel you want Silvanus to forward the notifications to.\n ``fruitmessage``: Optional: This sets the message to send when the tree is dropping fruit. If not set, the ``watermessage`` will be used instead.\n - Creates a menu for users to give themselves Water and Fruit pingable roles.\n Requires ``Manage Roles`` permission to run.\n ``waterrole``: Select the role to give users when they select the Water button\n ``fruitrole``: Optional: Select the role to give users when they select the Fruit button\n If this option isn't set, no Fruit Role will be available for self-assignment.\n - Calculates the wait time between waters for a tree of a given height.\n ``height``: The height in feet to calculate for.\n - Calculates how long it would take to grow to a height\n ``endheight``: The destination height, in feet.\n ``beginheight``: Optional: The starting height, in feet. If this option isn't set, the current height of your tree will be used insead.\n - Removes your server's configuration from the database.\n - Displays the bot's help page and links to each command." + "allCommands": " - Compare your tree to others on the leaderboard\n - Setup a Notification Relay for the first time\n - Update an already configured Notification Relay\n - Disable the Notification Relay\n - Send a self-assignable role menu for relay pings\n - Calculates the time between waters for a tree of a given height\n - Calculates how long it would take a tree to grow to a given height\n - Set the channels to use with \n - View your server's configuration\n - Delete your server's configuration\n - Displays the bot's help page" }, "commands": { "compare": "", diff --git a/modules/_prepareStrings.js b/modules/_prepareStrings.js index cb2ae16..8b06e50 100755 --- a/modules/_prepareStrings.js +++ b/modules/_prepareStrings.js @@ -1,34 +1,29 @@ -/* - - - - - - - - - - - -*/ - +const commands = [ + {raw: "`/compare`", clickable: ""}, + {raw: "`/relay set`", clickable: ""}, + {raw: "`/relay update`", clickable: ""}, + {raw: "`/relay disable`", clickable: ""}, + {raw: "`/rolemenu`", clickable: ""}, + {raw: "`/watertime`", clickable: ""}, + {raw: "`/timetoheight`", clickable: ""}, + {raw: "`/setup compare`", clickable: ""}, + {raw: "`/setup view`", clickable: ""}, + {raw: "`/setup reset`", clickable: ""}, + {raw: "`/help`", clickable: ""}, + {raw: "`/tree`", clickable: ""}, + {raw: "`/top trees`", clickable: ""}, + {raw: "`/commands`", clickable: ""} +]; const fs = require('fs'); const replaceAll = require('string.prototype.replaceall'); const path = "./modules/input.txt"; const string = fs.readFileSync(path).toString(); let newString = replaceAll(string, '\* ', ''); -newString = replaceAll(newString, '\r\n', '\\n'); +newString = replaceAll(newString, '\n', '\\n'); newString = replaceAll(newString, '\t', ' - '); -newString = replaceAll(newString, '`/setup`', ''); -newString = replaceAll(newString, '`/setupinfo`', ''); -newString = replaceAll(newString, '`/compare`', ''); -newString = replaceAll(newString, '`/watertime`', ''); -newString = replaceAll(newString, '`/timetoheight`', ''); -newString = replaceAll(newString, '`/reset`', ''); -newString = replaceAll(newString, '`/help`', ''); -newString = replaceAll(newString, '`/commands`', ''); -newString = replaceAll(newString, '`/notifications`', ''); -newString = replaceAll(newString, '`/rolemenu`', ''); +commands.forEach(command => { + newString = replaceAll(newString, command.raw, command.clickable); +}); newString = replaceAll(newString, '`', '``'); fs.writeFileSync(path, newString); return "Done"; \ No newline at end of file diff --git a/slash-commands/help.js b/slash-commands/help.js index 40a9141..a0bf9f1 100755 --- a/slash-commands/help.js +++ b/slash-commands/help.js @@ -14,7 +14,7 @@ module.exports = { { name: "True", value: "true" }, { name: "False", value: "false" })), execute(interaction) { - const helpEmbed = fn.builders.helpEmbed(`${strings.help.info}\n\n**Setup**\n${strings.help.setup}\n\nSee for a list of all my commands\n\n**Support Server**\n${strings.urls.supportServer}`, interaction.options.getString('private')); + const helpEmbed = fn.builders.helpEmbed(`${strings.help.info}\n\n**Setup**\n${strings.help.setup}\n\n**Support Server**\n${strings.urls.supportServer}`, interaction.options.getString('private')); interaction.reply(helpEmbed); }, }; \ No newline at end of file