mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-09-22 02:19:09 -04:00
[Scheduler] Expired bans now give a reason when audit logged. (#12)
This commit is contained in:
@@ -70,7 +70,7 @@ export default {
|
||||
}
|
||||
|
||||
try {
|
||||
await interaction.guild.bans.remove(user);
|
||||
await interaction.guild.bans.remove(user, 'User was softbanned.');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return await interaction.editReply("Error softbanning user (couldn't remove ban).");
|
||||
@@ -78,4 +78,4 @@ export default {
|
||||
|
||||
await interaction.editReply('Softban successful');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -11,12 +11,11 @@ export async function checkExpiredBans(client: Client) {
|
||||
|
||||
for (const ban of await Database.getExpiredBans(date)) {
|
||||
try {
|
||||
await guild.bans.remove(ban.user_id);
|
||||
await guild.bans.remove(ban.user_id, 'Ban expired.');
|
||||
} catch (e) {
|
||||
console.error(`Error unbanning user: ${ban.user_id}`);
|
||||
console.error(e);
|
||||
console.error(`Error unbanning user: ${ban.user_id}`, e);
|
||||
}
|
||||
}
|
||||
|
||||
await Database.pruneExpiredBans(date);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user