fixed help command

This commit is contained in:
SypherRed authored and GitHub committed 2021-11-25 01:51:56 +01:00
1 parent 31f6b9e08e
commit 0118b9e591
1 file changed
+11 -16
+11 -16
View File
@@ -25,22 +25,18 @@ module.exports = new Command({
permission: "SEND_MESSAGES", permission: "SEND_MESSAGES",
async run(interaction) { async run(interaction) {
let SupportStaff = let SupportStaff = interaction.guild.roles.cache.find(
interaction.guild.roles.cache.find( (SupportTeam) =>
(adminRole) => adminRole.name === supportbot.Staff SupportTeam.name === supportbot.Staff || SupportTeam.id === supportbot.Staff
) ||
interaction.guild.roles.cache.find(
(staffRole) => staffRole.id === supportbot.Staff
); );
let AdminStaff = let Admins = interaction.guild.roles.cache.find(
interaction.guild.roles.cache.find( (AdminUser) =>
(adminRole) => adminRole.name === supportbot.Admin AdminUser.name === supportbot.Admin || AdminUser.id === supportbot.Admin
) || );
interaction.guild.roles.cache.find( if (!SupportStaff || !Admins)
(adminRole) => adminRole.id === supportbot.Admin return interaction.reply(
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
); );
if (supportbot.HelpMenu) {
let botCommands = ""; let botCommands = "";
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`; botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`; botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
@@ -81,7 +77,7 @@ module.exports = new Command({
inline: false, inline: false,
}); });
} else { } else {
if (interaction.member.roles.cache.has(AdminStaff.id)) { if (interaction.member.roles.cache.has(Admins.id)) {
HelpEmbed1.addFields({ HelpEmbed1.addFields({
name: "🔐 Staff Commands\n", name: "🔐 Staff Commands\n",
value: `${staffCommands}\n`, value: `${staffCommands}\n`,
@@ -101,6 +97,5 @@ module.exports = new Command({
embeds: [HelpEmbed1], embeds: [HelpEmbed1],
}); });
} }
}
}, },
}); });