2021-10-21 19:28:23 +01:00
|
|
|
const fs = require("fs");
|
|
|
|
|
const Discord = require("discord.js");
|
2021-10-24 22:41:46 +01:00
|
|
|
const yaml = require("js-yaml");
|
2022-08-12 01:35:36 +01:00
|
|
|
|
2026-05-16 15:10:27 +01:00
|
|
|
const supportbot = require("../../Structures/ConfigStore").supportbot;
|
|
|
|
|
const cmdconfig = require("../../Structures/ConfigStore").commands;
|
2021-10-21 19:28:23 +01:00
|
|
|
|
2025-09-20 23:09:22 +01:00
|
|
|
const Command = require("../../Structures/Command.js");
|
2021-10-21 19:28:23 +01:00
|
|
|
|
|
|
|
|
module.exports = new Command({
|
2022-07-23 07:50:12 +01:00
|
|
|
name: cmdconfig.Help.Command,
|
|
|
|
|
description: cmdconfig.Help.Description,
|
2022-07-22 13:19:05 +01:00
|
|
|
type: Discord.ApplicationCommandType.ChatInput,
|
2021-12-18 18:57:26 -06:00
|
|
|
options: [],
|
2022-07-23 07:50:12 +01:00
|
|
|
permissions: cmdconfig.Help.Permission,
|
2021-10-21 19:28:23 +01:00
|
|
|
|
2021-10-24 22:41:46 +01:00
|
|
|
async run(interaction) {
|
2022-01-30 00:07:04 -06:00
|
|
|
const { getRole } = interaction.client;
|
2022-08-12 01:35:36 +01:00
|
|
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
|
|
|
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
2024-06-12 12:54:31 +01:00
|
|
|
if (!SupportStaff || !Admin) {
|
2021-11-25 01:51:56 +01:00
|
|
|
return interaction.reply(
|
|
|
|
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
2021-10-24 22:41:46 +01:00
|
|
|
);
|
2022-06-21 01:38:22 +01:00
|
|
|
}
|
2021-10-21 19:28:23 +01:00
|
|
|
|
2024-07-03 13:46:57 +01:00
|
|
|
// Separate regular commands and addon commands
|
2024-06-12 12:54:31 +01:00
|
|
|
let botCommands = "";
|
2024-07-03 13:46:57 +01:00
|
|
|
let addonCommands = "";
|
|
|
|
|
|
2024-06-12 12:54:31 +01:00
|
|
|
interaction.client.commands.forEach((command) => {
|
|
|
|
|
if (command.permissions) {
|
2024-07-03 13:46:57 +01:00
|
|
|
if (command.addon) {
|
|
|
|
|
addonCommands += `\`${command.name}\` `;
|
|
|
|
|
} else {
|
|
|
|
|
botCommands += `\`${command.name}\` `;
|
|
|
|
|
}
|
2024-06-12 12:54:31 +01:00
|
|
|
}
|
|
|
|
|
});
|
2021-10-24 22:41:46 +01:00
|
|
|
|
2024-06-12 12:54:31 +01:00
|
|
|
// Create embed
|
2022-07-22 13:19:05 +01:00
|
|
|
const HelpEmbed1 = new Discord.EmbedBuilder()
|
|
|
|
|
.setTitle(supportbot.General.Name + " Commands")
|
2021-11-25 01:51:56 +01:00
|
|
|
.setThumbnail(interaction.user.displayAvatarURL())
|
2022-08-11 19:19:29 +01:00
|
|
|
.setColor(supportbot.Embed.Colours.General)
|
2024-06-12 12:54:31 +01:00
|
|
|
.addFields({
|
|
|
|
|
name: "🖥️ Commands\n",
|
|
|
|
|
value: botCommands || "No commands available.",
|
|
|
|
|
inline: false,
|
2022-02-25 21:55:33 -06:00
|
|
|
});
|
2021-10-24 22:41:46 +01:00
|
|
|
|
2024-06-12 12:54:31 +01:00
|
|
|
HelpEmbed1.setFooter({
|
|
|
|
|
text: supportbot.Embed.Footer,
|
|
|
|
|
iconURL: interaction.user.displayAvatarURL(),
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-26 20:11:22 +01:00
|
|
|
await interaction.reply({
|
2025-09-20 23:09:22 +01:00
|
|
|
flags: Discord.MessageFlags.Ephemeral,
|
2024-06-12 12:54:31 +01:00
|
|
|
embeds: [HelpEmbed1],
|
|
|
|
|
});
|
2021-10-24 22:41:46 +01:00
|
|
|
},
|
2021-12-04 20:58:19 -06:00
|
|
|
});
|