From e484bf99624c5f549e3b7c78811d2e750aec34c7 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 23 Jan 2023 21:36:44 -0500 Subject: [PATCH] Streamline Help Page --- data/strings.json | 1 + modules/functions.js | 2 +- slash-commands/help.js | 45 ++++++++---------------------------------- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/data/strings.json b/data/strings.json index 2b27040..66b9f05 100644 --- a/data/strings.json +++ b/data/strings.json @@ -3,6 +3,7 @@ "name": "trees grow" }, "help": { + "title": "Silvanus 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.\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." diff --git a/modules/functions.js b/modules/functions.js index 1a0842a..a5c8e16 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -60,7 +60,7 @@ const functions = { helpEmbed(content, private) { const embed = new EmbedBuilder() .setColor(strings.embeds.color) - .setTitle('Grow A Tree Analyzer Help') + .setTitle(strings.help.title) .setDescription(content) .setFooter({ text: strings.embeds.footer }); const privateBool = private == 'true'; diff --git a/slash-commands/help.js b/slash-commands/help.js index 3ad4e16..07a1e40 100644 --- a/slash-commands/help.js +++ b/slash-commands/help.js @@ -6,44 +6,15 @@ module.exports = { data: new SlashCommandBuilder() .setName('help') .setDescription('Get help using the bot') - .addSubcommand(subcommand => - subcommand - .setName('info') - .setDescription('Learn about the bot') - .addStringOption(o => - o.setName('private') - .setDescription('Should the response be sent privately?') - .setRequired(true) - .addChoices( - { name: "True", value: "true" }, - { name: "False", value: "false" } - ))) - .addSubcommand(subcommand => - subcommand - .setName('setup') - .setDescription('Learn how to setup the bot') - .addStringOption(o => - o.setName('private') - .setDescription('Should the response be sent privately?') - .setRequired(true) - .addChoices( - { name: "True", value: "true" }, - { name: "False", value: "false" } - ))) - .addSubcommand(subcommand => - subcommand - .setName('permissions') - .setDescription('Learn about the bot\'s permissions') - .addStringOption(o => - o.setName('private') - .setDescription('Should the response be sent privately?') - .setRequired(true) - .addChoices( - { name: "True", value: "true" }, - { name: "False", value: "false" } - ))), + .addStringOption(o => + o.setName('private') + .setDescription('Should the response be sent privately?') + .setRequired(true) + .addChoices( + { name: "True", value: "true" }, + { name: "False", value: "false" })), execute(interaction) { - const helpEmbed = fn.builders.helpEmbed(strings.help[interaction.options.getSubcommand()], interaction.options.getString('private')); + const helpEmbed = fn.builders.helpEmbed(`${strings.help.info}\n\n**Setup**\n${strings.help.setup}`, interaction.options.getString('private')); interaction.reply(helpEmbed); }, }; \ No newline at end of file