Skip to content

Commit

Permalink
Fix logging timeouts from the guild audit log create event
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Apr 28, 2023
1 parent 7e013dd commit d214a83
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/events/discord/GuildAuditLogCreateEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ export default class GuildAuditLogCreateEventListener extends EventListener {
if (change.key === 'communication_disabled_until') {
wasMuted ??= change.old !== null;
if (change.new === null) {
action = 'mute';
duration = new Date(/** @type {string}*/ change.new) - Date.now();
}
else {
// ignore mutes that were instantly reverted
action = wasMuted ? 'unmute' : null;
} else {
action = 'mute';
duration = new Date(/** @type {string}*/ change.new) - Date.now();
}
}
}
Expand Down

0 comments on commit d214a83

Please sign in to comment.