From 51a81ad21c8b525a7f4e6297a6b6155588856c8e Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Mon, 1 Aug 2022 13:43:41 -0700 Subject: [PATCH] revamp help command --- commands/help.js | 180 ++++++++++++++++++++++++++++++++----------- commands/settings.js | 12 +-- 2 files changed, 139 insertions(+), 53 deletions(-) diff --git a/commands/help.js b/commands/help.js index 7403e53..94b8ab4 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,7 +4,7 @@ module.exports = { name: "help", debug: false, description: "Get information on a specific command", - usage: "[command]", + usage: "[option]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], member: [], @@ -12,12 +12,30 @@ module.exports = { SlashCommand: { options: [ { - name: "command", - description: "Get information on a specific command", - value: "command", - type: 3, - required: false, + name: "commands", + description: "list all commands", + value: "commands", + type: 1, + options: [{ + name: "command", + description: "Get information on a specific command", + value: "command", + type: 3, + required: false, + }] }, + { + name: "settings", + description: "how to configure the settings", + value: "settings", + type: 1, + }, + { + name: "support", + description: "get support for QuarksBot", + value: "support", + type: 1, + } ], /** * @@ -31,50 +49,118 @@ module.exports = { if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) { return interaction.send(`You are not allowed to use the bot in this channel.`); } - let Commands = client.commands.filter((cmd) => { - return !cmd.debug - }).map((cmd) => - `\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` - ); - - let Embed = new MessageEmbed() - .setColor(client.config.EmbedColor) - .setDescription(`${Commands.join("\n")} + if (args[0].name == 'commands') { + let Commands = client.commands.filter((cmd) => { + return !cmd.debug + }).map((cmd) => + `\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` + ); - QuarksBot Version: v${client.config.Version}`); - if (!args) return interaction.send(Embed); - else { - let cmd = - client.commands.get(args[0].value) || - client.commands.find( - (x) => x.aliases && x.aliases.includes(args[0].value) - ); - if (!cmd) - return client.sendTime( - interaction, - `❌ | Unable to find that command.` - ); + let Embed = new MessageEmbed() + .setColor(client.config.EmbedColor) + .setDescription(`${Commands.join("\n")} + + QuarksBot Version: v${client.config.Version}`); + if (!args[0].options[0]) return interaction.send(Embed); + else { + let cmd = + client.commands.get(args[0].options[0].value) || + client.commands.find( + (x) => x.aliases && x.aliases.includes(args[0].options[0].value) + ); + if (!cmd) + return client.sendTime( + interaction, + `❌ | Unable to find that command.` + ); + + let embed = new MessageEmbed() + .setDescription(cmd.description) + .setColor("GREEN") + .addField( + "Usage", + `\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`, + true + ) + .addField( + "Permissions", + "Member: " + + cmd.permissions.member.join(", ") + + "\nBot: " + + cmd.permissions.channel.join(", "), + true + ); + + return interaction.send(embed); + } + } else if (args[0].name == 'settings') { + const settingsHelp = new MessageEmbed() + .setColor(client.config.EmbedColor) + .setTitle('Using settings command to configure your guild') + .setDescription(`Some features of QuarksBot require, or recommend settings. + + **__1. Action Channel:__** + Optionally you can have a dedicated channel for the \`/me\` command, keeping your channels clean. + Use \`/settings action_channel set [channel]\` to configure this setting. + + or... - let embed = new MessageEmbed() - .setDescription(cmd.description) - .setColor("GREEN") - //.addField("Name", cmd.name, true) - .addField("Aliases", cmd.aliases.join(", "), true) - .addField( - "Usage", - `\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`, - true - ) - .addField( - "Permissions", - "Member: " + - cmd.permissions.member.join(", ") + - "\nBot: " + - cmd.permissions.channel.join(", "), - true - ); + use \`/settings action_channel remove [channel]\` to remove your dedicated action channel. - interaction.send(embed); + **__2. Tweet Channel:__** + Optionally you can have a dedicated channel for the \`/tweet\` command, keeping your channels clean. + Use \`/settings tweet_channel set [channel]\` to configure this setting. + + or ... + + use \`/settings tweet_channel remove [channel]\` to remove your dedicated tweet channel. + + + **__3. Allowed Channels:__** + If you want to limit what channels people can use QuarksBot, + use \`/settings allowed_channels add [channel]\` to add a channel to a list of allowed channels. + + or... + + use \`/settings allowed_channels remove [channel]\` to remove a channel from the list of allowed channels. + + **__4. Starting Balance:__** + When a user joins your server, they get a starting balance. This can be configured, + use \`/settings starting_balance [amount]\` to set the starting balance. + + **__5. Income Roles:__** + The \`/work\` command required a user to have a role that has a defined income. + Use \`/settings set_income_role [role] [amount]\` to add a role to the list of roles to earn income. + + or... + + use \`/settings remove_income_role [role]\` to remove a role from the list of roles to earn income. + + **Note:** + - Users may only use \`/work\` command once every 24 hours. + - If a user has more than one role that can earn income, the bot will pay them for the role with the highest income. + - The amount you enter for a role to earn is the amount they will be paid when using the \`/work\` command. Be sure that the amount you choose is a daily income, not hourly, etc. + + **__6. Viewing Settings:__** + If you are unsure of your current configured settings, use \`/settings view\` to get a detailed view of your configurations.`); + + return interaction.send({ embeds: [settingsHelp] }); + + } else if (args[0].name == 'support') { + const supportEmbed = new MessageEmbed() + .setColor(client.config.EmbedColor) + .setDescription(`**__QuarksBot Support__** + + Are you experiencing troubles with QuarksBot? + Do you have questions or concerns? + Do you require help to use the bot? + Do you have a feature you'd like to see? + + Join the support server to have all your needs fulfilled. + ╚➤ ${client.config.SupportServer} + `) + + return interaction.send({ embeds: [supportEmbed] }); } }, }, diff --git a/commands/settings.js b/commands/settings.js index 58070fc..97814c1 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -43,9 +43,9 @@ module.exports = { type: 1, options: [ { - name: "add_or_remove", - description: "add/remove channel", - value: "add_or_remove", + name: "set_or_remove", + description: "set/remove channel", + value: "set_or_remove", type: 3, required: true, choices: [ @@ -68,9 +68,9 @@ module.exports = { type: 1, options: [ { - name: "add_or_remove", - description: "add/remove channel", - value: "add_or_remove", + name: "set_or_remove", + description: "set/remove channel", + value: "set_or_remove", type: 3, required: true, choices: [