mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-09-22 10:29:10 -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 {
|
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).");
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user