diff --git a/data/strings.json b/data/strings.json index e20ffd5..2b27040 100644 --- a/data/strings.json +++ b/data/strings.json @@ -3,7 +3,7 @@ "name": "trees grow" }, "help": { - "info": "This bot will analyze your tree (from the Grow A Tree Bot by Limbo Labs) and compare its growth to other trees displayed on the leaderboard.\n\nThis bot assumes that there is a single message and a single message that everyone uses. If everyone creates their own and , the reference messages will have to be updated every time, or old data will be displayed.", + "info": "This bot will analyze your tree (from the Grow A Tree Bot by Limbo Labs) and compare its growth to other trees displayed on the leaderboard.\n\nThis bot assumes that there is a single message and a single message that everyone uses. If everyone creates their own and , the reference messages will have to be updated every time, or old data will be displayed.\n\nSeeing old data? Try running again, sometimes configurations get lost.", "setup": "To begin analyzing your Tree, first you must set up the reference messages.\n\n1. Run in the channel(s) that contain your server's tree and leaderboard messages.\n2. Now simply run where you want your analysis to be visible.", "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." }, @@ -21,5 +21,13 @@ "urls": { "avatar": "https://cdn.discordapp.com/avatars/513184762073055252/12227aa23a06d5178853e59b72c7487b.webp?size=128" }, + "error": { + "noGuild": "Setup has not been completed yet. Try running or " + }, + "status": { + "treeAndLeaderboard": "Tree and leaderboard messages were both found, setup is complete. Run to verify. Run to get started!", + "treeNoLeaderboard": "A tree message was found, but a leaderboard message was not. Please run this command again in the channel containing the leaderboard if you haven't done so already. Run to see if the message is set.", + "leaderboardNoTree": "A leaderboard message was found, but a tree message was not. Please run this command again in the channel containing the tree if you haven't done so already. Run to see if the message is set." + }, "temp": {} } \ No newline at end of file diff --git a/modules/functions.js b/modules/functions.js index 811ad19..1a0842a 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -90,7 +90,7 @@ const functions = { parse(interaction) { return new Promise ((resolve, reject) => { if (guildInfo[interaction.guildId] == undefined) { - reject("The guild entry hasn't been created yet."); + reject(strings.error.noGuild); return; } if (guildInfo[interaction.guildId].rankMessageId != undefined) { diff --git a/slash-commands/setup.js b/slash-commands/setup.js index 54b7255..6650240 100644 --- a/slash-commands/setup.js +++ b/slash-commands/setup.js @@ -1,6 +1,7 @@ const { SlashCommandBuilder } = require('discord.js'); const fn = require('../modules/functions.js'); const guildInfo = require('../data/guildInfo.json'); +const strings = require('../data/strings.json'); module.exports = { data: new SlashCommandBuilder() @@ -37,11 +38,11 @@ module.exports = { } }); if (treeFound && !(rankFound)) { - interaction.reply(fn.builders.embed("A tree message was found, but a leaderboard message was not. Please run this command again in the channel containing the leaderboard if you haven't done so already. Run ``/setupinfo`` to see if the message is set.")); + interaction.reply(fn.builders.embed(strings.status.treeNoLeaderboard)); } else if (!(treeFound) && rankFound) { - interaction.reply(fn.builders.embed("A leaderboard message was found, but a tree message was not. Please run this command again in the channel containing the tree if you haven't done so already. Run ``/setupinfo`` to see if the message is set.")); + interaction.reply(fn.builders.embed(strings.status.leaderboardNoTree)); } else if (treeFound && rankFound) { - interaction.reply(fn.builders.embed("Tree and leaderboard messages were both found, setup is complete. Run ``/setupinfo`` to verify.")); + interaction.reply(fn.builders.embed(strings.status.treeAndLeaderboard)); } }); },