Add per-guild moderation settings and records
This commit is contained in:
@@ -14,22 +14,20 @@ module.exports = {
|
||||
}
|
||||
|
||||
try {
|
||||
if (command.permissionGroup) {
|
||||
const allowed = await isCommandAllowed({
|
||||
guildId: interaction.guildId,
|
||||
userId: interaction.user.id,
|
||||
member: interaction.member,
|
||||
commandName: interaction.commandName,
|
||||
permissionGroup: command.permissionGroup,
|
||||
});
|
||||
const allowed = await isCommandAllowed({
|
||||
guildId: interaction.guildId,
|
||||
userId: interaction.user.id,
|
||||
member: interaction.member,
|
||||
commandName: interaction.commandName,
|
||||
permissionGroup: command.permissionGroup,
|
||||
});
|
||||
|
||||
if (!allowed) {
|
||||
await interaction.reply({
|
||||
content: 'You do not have permission to use this command.',
|
||||
flags: MessageFlags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!allowed) {
|
||||
await interaction.reply({
|
||||
content: 'You do not have permission to use this command.',
|
||||
flags: MessageFlags.Ephemeral,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await command.execute(interaction);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const { Events } = require('discord.js');
|
||||
const { connectToDatabase } = require('../db.js');
|
||||
const { clearBanStatus } = require('../services/moderationRecords');
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
@@ -30,6 +31,10 @@ module.exports = {
|
||||
await guild.bans.remove(banData.userId);
|
||||
|
||||
await tempBanCollection.deleteOne({ _id: banData._id });
|
||||
await clearBanStatus({
|
||||
guildId: banData.guildId,
|
||||
userId: banData.userId,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Error unbanning member:', err);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user