silvanus/slash-commands/help.js

49 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-01-19 01:10:05 +00:00
const { SlashCommandBuilder, messageLink } = require('discord.js');
2023-01-19 17:44:49 +00:00
const fn = require('../modules/functions.js');
const strings = require('../data/strings.json');
2023-01-19 01:10:05 +00:00
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" }
))),
execute(interaction) {
const helpEmbed = fn.builders.helpEmbed(strings.help[interaction.options.getSubcommand()], interaction.options.getString('private'));
interaction.reply(helpEmbed);
},
};