From f78caf47839c31345922165ca148e649cf3228c3 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 12 Feb 2023 18:03:23 -0500 Subject: [PATCH] Documentation update --- .gitignore | 1 + README.md | 23 ++++++++++++++++------- data/strings.json | 2 +- modules/_prepareStrings.js | 11 ++++++----- package.json | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index b9e44c7..1ddee34 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ env.prod .DS_Store data/guildInfo.json data/rawstring.txt +modules/input.txt # Custom folders # gifs/* diff --git a/README.md b/README.md index 017087a..7327bd4 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,23 @@ Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` ## Commands * `/setup` - You only need to run this command if your server has its `/tree` and `/top trees` messages in separate channels. -* `/setupinfo` - Displays links to the current Tree and Tallest Trees messages configured in your server. +* `/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 (`[💧]`). -* `/setping` - Guild members with the `Manage Roles` permission can run this command to set up automatic reminders when your tree is ready to be watered. - * Type a reminder message (including any `@pings` desired) and select a channel to send the reminders in. - * Once this command has been run a new `Reset Ping` button will appear next time you refresh the `/compare` message. - * Click the `Reset Ping` button to be sent a reminder the next time the tree is ready to be watered. - * Use `/optout` to disable reminder messages for your server. +* `/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. -* `/timetoheight` - Calculates how long it would take to go from `beginheight` to `endheight`. + * `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 diff --git a/data/strings.json b/data/strings.json index a0399a6..18280d2 100644 --- a/data/strings.json +++ b/data/strings.json @@ -7,7 +7,7 @@ "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.", "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 links to the current Tree and Tallest Trees messages configured in your server.\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.\n Type a reminder message (including any ``@pings`` desired) and select a channel to send the reminders in.\n Once this command has been run a new ``Reset Ping`` button will appear next time you refresh the message.\n Click the ``Reset Ping`` button to be sent a reminder the next time the tree is ready to be watered.\n Use to disable reminder messages for your server.\n - Calculates the wait time between waters for a tree of a given height.\n - Calculates how long it would take to go from ``beginheight`` to ``endheight``.\n - Removes your server's configuration from the database.\n - Displays the bot's help page and links to each command." + "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." }, "commands": { "compare": "", diff --git a/modules/_prepareStrings.js b/modules/_prepareStrings.js index 1c26722..cb2ae16 100644 --- a/modules/_prepareStrings.js +++ b/modules/_prepareStrings.js @@ -14,20 +14,21 @@ const fs = require('fs'); const replaceAll = require('string.prototype.replaceall'); -const string = fs.readFileSync('./data/rawstring.txt').toString(); +const path = "./modules/input.txt"; +const string = fs.readFileSync(path).toString(); let newString = replaceAll(string, '\* ', ''); -newString = replaceAll(newString, '\n', '\\n'); +newString = replaceAll(newString, '\r\n', '\\n'); newString = replaceAll(newString, '\t', ' - '); newString = replaceAll(newString, '`/setup`', ''); newString = replaceAll(newString, '`/setupinfo`', ''); newString = replaceAll(newString, '`/compare`', ''); -newString = replaceAll(newString, '`/setping`', ''); -newString = replaceAll(newString, '`/optout`', ''); 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`', ''); newString = replaceAll(newString, '`', '``'); -fs.writeFileSync('./data/rawstring.txt', newString); +fs.writeFileSync(path, newString); return "Done"; \ No newline at end of file diff --git a/package.json b/package.json index bb83dcc..12e8912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "silvanus", - "version": "1.1.5", + "version": "1.2.1", "description": "Grow A Tree Companion Bot", "main": "main.js", "scripts": {