[Scheduler] Expired bans now give a reason when audit logged. (#12)

This commit is contained in:
2026-08-26 00:39:28 +08:00
committed by GitHub
parent cb2348f89c
commit 896d3fc4d9
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ export default {
} }
try { try {
await interaction.guild.bans.remove(user); await interaction.guild.bans.remove(user, 'User was softbanned.');
} catch (e) { } catch (e) {
console.error(e); console.error(e);
return await interaction.editReply("Error softbanning user (couldn't remove ban)."); return await interaction.editReply("Error softbanning user (couldn't remove ban).");
+2 -3
View File
@@ -11,10 +11,9 @@ export async function checkExpiredBans(client: Client) {
for (const ban of await Database.getExpiredBans(date)) { for (const ban of await Database.getExpiredBans(date)) {
try { try {
await guild.bans.remove(ban.user_id); await guild.bans.remove(ban.user_id, 'Ban expired.');
} catch (e) { } catch (e) {
console.error(`Error unbanning user: ${ban.user_id}`); console.error(`Error unbanning user: ${ban.user_id}`, e);
console.error(e);
} }
} }