Added getRole, getChannel, getCategory functions
This commit is contained in:
1 parent
6107d268f7
commit
2c7be5882c
9 files changed
+97
-120
No files matched your search
+5
-11
@@ -31,17 +31,11 @@ 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
|
||||
);
|
||||
const { getRole, getChannel, getCategory } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||
|
||||
if (!SupportStaff || !Admins)
|
||||
if (!SupportStaff || !Admin)
|
||||
return interaction.reply(
|
||||
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||
);
|
||||
@@ -54,7 +48,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)
|
||||
) {
|
||||
const EmbedTitle = interaction.options.getString("title");
|
||||
const EmbedSubject = interaction.options.getString("message");
|
||||
|
||||
Reference in new issue
Block a user