Added getRole, getChannel, getCategory functions

This commit is contained in:
Noah committed 2021-12-15 00:19:40 -06:00
1 parent 6107d268f7
commit 2c7be5882c
9 files changed
+97 -120

No files matched your search

+5 -11
View File
@@ -25,16 +25,10 @@ module.exports = new Command({
permission: "SEND_MESSAGES",
async run(interaction) {
let SupportStaff = interaction.guild.roles.cache.find(
(SupportTeam) =>
SupportTeam.name === supportbot.Staff ||
SupportTeam.id === supportbot.Staff
);
let Admins = interaction.guild.roles.cache.find(
(AdminUser) =>
AdminUser.name === supportbot.Admin || AdminUser.id === supportbot.Admin
);
if (!SupportStaff || !Admins)
const { getRole, getChannel, getCategory } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!SupportStaff || !Admin)
return interaction.reply(
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
);
@@ -74,7 +68,7 @@ module.exports = new Command({
if (
interaction.member.roles.cache.has(SupportStaff.id) ||
interaction.member.roles.cache.has(Admins.id)
interaction.member.roles.cache.has(Admin.id)
) {
HelpEmbed1.addFields({
name: "🔐 Staff Commands\n",