fix(logging): don't log useless messageDelete events

This commit is contained in:
Isaac 2023-05-29 23:01:36 +01:00
parent f1029b8320
commit 6b066c177a
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -13,6 +13,9 @@ module.exports = class extends Listener {
}); });
} }
/**
* @param {import("discord.js").Message} message
*/
async run(message) { async run(message) {
/** @type {import("client")} */ /** @type {import("client")} */
const client = this.client; const client = this.client;
@ -64,15 +67,17 @@ module.exports = class extends Listener {
} }
} }
await logMessageEvent(this.client, { if (message.author.id !== client.user.id && !message.flags.has('Ephemeral')) {
action: 'delete', await logMessageEvent(this.client, {
diff: { action: 'delete',
original: { content }, diff: {
updated: { content: '' }, original: { content },
}, updated: { content: '' },
executor, },
target: message, executor,
ticket, target: message,
}); ticket,
});
}
} }
}; };