2021-10-21 19:28:23 +01:00
|
|
|
// SupportBot | Emerald Services
|
2021-10-24 22:41:46 +01:00
|
|
|
// Help Command
|
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
|
|
|
|
2021-10-27 19:30:10 -05:00
|
|
|
const supportbot = yaml.load(
|
|
|
|
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
|
|
|
);
|
2022-08-12 01:35:36 +01:00
|
|
|
|
|
|
|
|
const cmdconfig = yaml.load(
|
|
|
|
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
|
|
|
|
);
|
2021-10-21 19:28:23 +01:00
|
|
|
|
|
|
|
|
const Command = require("../Structures/Command.js");
|
|
|
|
|
|
|
|
|
|
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-07-23 07:50:12 +01:00
|
|
|
let disableCommand = true;
|
|
|
|
|
|
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);
|
2021-12-15 00:19:40 -06:00
|
|
|
if (!SupportStaff || !Admin)
|
2022-08-12 01:35:36 +01:00
|
|
|
|
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
|
|
|
);
|
2021-12-04 20:58:19 -06:00
|
|
|
|
2021-11-25 01:51:56 +01:00
|
|
|
let botCommands = "";
|
2022-07-23 07:50:12 +01:00
|
|
|
botCommands += ` \`${cmdconfig.Help.Command}\` `;
|
|
|
|
|
botCommands += `\`${cmdconfig.Ping.Command}\` `;
|
|
|
|
|
botCommands += `\`${cmdconfig.Info.Command}\` `;
|
2022-06-21 01:38:22 +01:00
|
|
|
|
2022-06-21 01:41:53 +01:00
|
|
|
if (supportbot.DisableSuggestions === false) {
|
2022-07-23 07:50:12 +01:00
|
|
|
botCommands += `\`${cmdconfig.Suggestion.Command}\` `;
|
2022-06-21 01:38:22 +01:00
|
|
|
}
|
2021-10-21 19:28:23 +01:00
|
|
|
|
2021-11-25 01:51:56 +01:00
|
|
|
let ticketCommands = "";
|
2022-07-23 07:50:12 +01:00
|
|
|
ticketCommands += ` \`${cmdconfig.OpenTicket.Command}\` `;
|
|
|
|
|
ticketCommands += `\`${cmdconfig.CloseTicket.Command}\` `;
|
2021-10-24 22:41:46 +01:00
|
|
|
|
2021-11-25 01:51:56 +01:00
|
|
|
let staffCommands = "";
|
2022-07-23 07:50:12 +01:00
|
|
|
staffCommands += ` \`${cmdconfig.TicketAdd.Command}\` `;
|
|
|
|
|
staffCommands += `\`${cmdconfig.TicketRemove.Command}\` `;
|
|
|
|
|
staffCommands += `\`${cmdconfig.UserInfo.Command}\` `;
|
|
|
|
|
staffCommands += `\`${cmdconfig.Translate.Command}\` `;
|
2021-10-24 22:41:46 +01:00
|
|
|
|
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)
|
2021-11-25 01:51:56 +01:00
|
|
|
.addFields(
|
|
|
|
|
{
|
2022-08-12 01:35:36 +01:00
|
|
|
name: "🖥️ Commands\n",
|
|
|
|
|
value: `${botCommands} ${ticketCommands} ${staffCommands}\n`,
|
2021-11-25 01:51:56 +01:00
|
|
|
inline: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-08-12 01:35:36 +01:00
|
|
|
name: "🖥️ Addons\n",
|
|
|
|
|
value: `\`hello\`\n`,
|
2021-11-25 01:51:56 +01:00
|
|
|
inline: false,
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-10-24 22:41:46 +01:00
|
|
|
|
2022-08-11 19:19:29 +01:00
|
|
|
.setColor(supportbot.Embed.Colours.General)
|
2022-02-25 21:55:33 -06:00
|
|
|
.setFooter({
|
2022-08-11 19:19:29 +01:00
|
|
|
text: supportbot.Embed.Footer,
|
2022-02-25 21:55:33 -06:00
|
|
|
iconURL: interaction.user.displayAvatarURL(),
|
|
|
|
|
});
|
2021-10-24 22:41:46 +01:00
|
|
|
|
2021-11-25 01:51:56 +01:00
|
|
|
interaction.reply({
|
2022-06-16 02:31:58 +01:00
|
|
|
ephemeral: true,
|
2021-11-25 01:51:56 +01:00
|
|
|
embeds: [HelpEmbed1],
|
|
|
|
|
});
|
2021-10-24 22:41:46 +01:00
|
|
|
},
|
2021-12-04 20:58:19 -06:00
|
|
|
});
|