From db7af90caeeee25ca0650aacad00aec954f0a0dc Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 30 Jan 2023 19:27:59 -0500 Subject: [PATCH] Documentation update --- .gitignore | 1 + README.md | 15 ++++++++------- data/strings.json | 2 +- modules/_prepareStrings.js | 37 +++++++++++++++++-------------------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index b7a3af7..b9e44c7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ env.dev env.prod .DS_Store data/guildInfo.json +data/rawstring.txt # Custom folders # gifs/* diff --git a/README.md b/README.md index 4d5bbba..017087a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Silvanus -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! Get started with `/help` and `/setup`, then check out `/compare`. +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! -Important Note: Silvanus is only as up-to-date as your server's Tree and Tallest Trees messages. Make sure to refresh them before refreshing Silvanus' Compare message. - -For the best experience we recommend the use of a single /tree and /top trees message, otherwise make sure to run /setup each time you run `/compare`. +Important 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. Silvanus is not affiliated with Grow A Tree or Limbo Labs. @@ -14,9 +12,12 @@ Silvanus is not affiliated with Grow A Tree or Limbo Labs. [Join Discord Server](https://discord.gg/g5JRGn7PxU) ## Setup -To begin analyzing your Tree, first you must set up the reference messages. -1. Run `/setup` in the channel(s) that contain your server's tree and leaderboard messages. -2. Now simply run `/compare` where you want your analysis to be visible. + +If your `/tree` and `/top trees` messages are in the same channel, simple 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. + +Use `/commands` to view a description of all my commands. ## Permissions Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. diff --git a/data/strings.json b/data/strings.json index d6abb0f..afb5fcc 100644 --- a/data/strings.json +++ b/data/strings.json @@ -5,7 +5,7 @@ "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;", + "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." }, diff --git a/modules/_prepareStrings.js b/modules/_prepareStrings.js index f9a7de2..1c26722 100644 --- a/modules/_prepareStrings.js +++ b/modules/_prepareStrings.js @@ -14,23 +14,20 @@ const fs = require('fs'); const replaceAll = require('string.prototype.replaceall'); - -function convertHelpString() { - const string = fs.readFileSync('./string.txt').toString(); - let newString = replaceAll(string, '\* ', ''); - newString = replaceAll(newString, '\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, '`', '``'); - return newString; -} - -module.exports = convertHelpString(); \ No newline at end of file +const string = fs.readFileSync('./data/rawstring.txt').toString(); +let newString = replaceAll(string, '\* ', ''); +newString = replaceAll(newString, '\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, '`', '``'); +fs.writeFileSync('./data/rawstring.txt', newString); +return "Done"; \ No newline at end of file