Skip to content

Commit

Permalink
ignore audit log entries without an executor, fix timeout duration
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Apr 28, 2023
1 parent d214a83 commit 8279888
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modbot",
"version": "3.3.0",
"version": "3.3.2",
"description": "Discord Bot for the Aternos Discord server",
"main": "index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src/events/discord/GuildAuditLogCreateEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class GuildAuditLogCreateEventListener extends EventListener {
* @return {Promise<void>}
*/
async execute(entry, guild) {
if (entry.executor.bot) {
if (!entry.executor || entry.executor.bot) {
return;
}

Expand Down Expand Up @@ -55,7 +55,7 @@ export default class GuildAuditLogCreateEventListener extends EventListener {
action = wasMuted ? 'unmute' : null;
} else {
action = 'mute';
duration = new Date(/** @type {string}*/ change.new) - Date.now();
duration = Math.floor((new Date(/** @type {string}*/ change.new) - Date.now()) / 1000);
}
}
}
Expand Down

0 comments on commit 8279888

Please sign in to comment.