Updated the way the verification system works and added custom admin role integration

This commit is contained in:
ION606
2022-10-23 18:23:11 -04:00
parent 18894961bd
commit 4043038162
8 changed files with 321 additions and 88 deletions
+17 -15
View File
@@ -8,24 +8,26 @@ module.exports = {
const arg = interaction.options.data[0];
const guild = bot.guilds.cache.get(interaction.guildId);
if (!checkRole(bot, guild, interaction.user.id)) { return interaction.reply('Insufficient Permissions!'); }
checkRole(bot, guild, interaction.user.id).then((isAllowed) => {
if (isAllowed) { return interaction.reply('Insufficient Permissions!'); }
var channel;
if (arg) {
channel = arg.channel;
} else {
channel = interaction.channel;
}
var channel;
if (arg) {
channel = arg.channel;
} else {
channel = interaction.channel;
}
let role = interaction.guild.roles.cache.find(r => r.name === "@everyone");
channel.permissionOverwrites.edit(role.id, {
VIEW_CHANNEL: true,
SEND_MESSAGES: false,
READ_MESSAGE_HISTORY: true,
ATTACH_FILES: false
let role = interaction.guild.roles.cache.find(r => r.name === "@everyone");
channel.permissionOverwrites.edit(role.id, {
VIEW_CHANNEL: true,
SEND_MESSAGES: false,
READ_MESSAGE_HISTORY: true,
ATTACH_FILES: false
});
interaction.reply(`${channel} has been locked!`);
});
interaction.reply(`${channel} has been locked!`);
},
options: [{name: 'channel', description: 'The channel to lock (defaults to current channel)', type: Constants.ApplicationCommandOptionTypes.CHANNEL, required: false}]
}