Documentation update

This commit is contained in:
Skylar Grant 2023-02-20 15:14:41 -05:00
parent d3a04921d6
commit c2fe7bfa9a
4 changed files with 37 additions and 52 deletions

View File

@ -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.
* `/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

View File

@ -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 </compare:1065346941166297128> in that channel and you're good to go!\n\nOtherwise, run </setup:1065407649363005561> to set the proper channels for the bot to look in for the ``/tree`` and ``/top trees`` messages.\n\nUse </commands:1069501270454456331> to view a description of all my commands.",
"setup": "If your </tree:972648557796524032> and </top trees:1051840665362894950> messages are in the same channel, simply run </compare:1065346941166297128> in that channel and you're good to go!\n\nOtherwise, run </setup compare:1065407649363005561> to set the proper channels for the bot to look in for the </tree:972648557796524032> and </top trees:1051840665362894950> messages.\n\nUse </commands:1077058896469966888> 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": "</setup:1065407649363005561> - You only need to run this command if your server has its ``/tree`` and ``/top trees`` messages in separate channels.\n</setupinfo:1065413032374706196> - Displays your server's configuration information.\n</compare:1065346941166297128> - 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</notifications:0> - 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</rolemenu:0> - 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</watertime:1066970330029113444> - Calculates the wait time between waters for a tree of a given height.\n ``height``: The height in feet to calculate for.\n</timetoheight:1067727254634889227> - 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</reset:1065412317052944476> - Removes your server's configuration from the database.\n</help:1065346941166297129> - Displays the bot's help page and links to each command."
"allCommands": "</compare:1077058896469966889> - Compare your tree to others on the leaderboard\n</relay set:0> - Setup a Notification Relay for the first time\n</relay update:0> - Update an already configured Notification Relay\n</relay disable:0> - Disable the Notification Relay\n</rolemenu:1077058896469966892> - Send a self-assignable role menu for relay pings\n</watertime:1077058896469966895> - Calculates the time between waters for a tree of a given height\n</timetoheight:1077058896469966894> - Calculates how long it would take a tree to grow to a given height\n</setup compare:1077058896469966893> - Set the channels to use with </compare:1077058896469966889>\n</setup view:1077058896469966893> - View your server's configuration\n</setup reset:1077058896469966893> - Delete your server's configuration\n</help:1077058896469966890> - Displays the bot's help page"
},
"commands": {
"compare": "</compare:1065346941166297128>",

View File

@ -1,34 +1,29 @@
/*
</setup:1065407649363005561>
</setupinfo:1065413032374706196>
</compare:1065346941166297128>
</setping:1068373237995683902>
</optout:1068753032801693758>
</watertime:1066970330029113444>
</timetoheight:1067727254634889227>
</reset:1065412317052944476>
</help:1065346941166297129>
</tree:972648557796524032>
</top trees:1051840665362894950>
*/
const commands = [
{raw: "`/compare`", clickable: "</compare:1077058896469966889>"},
{raw: "`/relay set`", clickable: "</relay set:0>"},
{raw: "`/relay update`", clickable: "</relay update:0>"},
{raw: "`/relay disable`", clickable: "</relay disable:0>"},
{raw: "`/rolemenu`", clickable: "</rolemenu:1077058896469966892>"},
{raw: "`/watertime`", clickable: "</watertime:1077058896469966895>"},
{raw: "`/timetoheight`", clickable: "</timetoheight:1077058896469966894>"},
{raw: "`/setup compare`", clickable: "</setup compare:1077058896469966893>"},
{raw: "`/setup view`", clickable: "</setup view:1077058896469966893>"},
{raw: "`/setup reset`", clickable: "</setup reset:1077058896469966893>"},
{raw: "`/help`", clickable: "</help:1077058896469966890>"},
{raw: "`/tree`", clickable: "</tree:972648557796524032>"},
{raw: "`/top trees`", clickable: "</top trees:1051840665362894950>"},
{raw: "`/commands`", clickable: "</commands:1077058896469966888>"}
];
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`', '</setup:1065407649363005561>');
newString = replaceAll(newString, '`/setupinfo`', '</setupinfo:1065413032374706196>');
newString = replaceAll(newString, '`/compare`', '</compare:1065346941166297128>');
newString = replaceAll(newString, '`/watertime`', '</watertime:1066970330029113444>');
newString = replaceAll(newString, '`/timetoheight`', '</timetoheight:1067727254634889227>');
newString = replaceAll(newString, '`/reset`', '</reset:1065412317052944476>');
newString = replaceAll(newString, '`/help`', '</help:1065346941166297129>');
newString = replaceAll(newString, '`/commands`', '</commands:1069501270454456331>');
newString = replaceAll(newString, '`/notifications`', '</notifications:0>');
newString = replaceAll(newString, '`/rolemenu`', '</rolemenu:0>');
commands.forEach(command => {
newString = replaceAll(newString, command.raw, command.clickable);
});
newString = replaceAll(newString, '`', '``');
fs.writeFileSync(path, newString);
return "Done";

View File

@ -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 </commands:0> 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);
},
};