This commit is contained in:
Jonny_Bro (Nikita) 2024-07-17 20:32:45 +05:00
parent b2070ba6cb
commit e4ac2624ae
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -1,4 +1,5 @@
const BaseEvent = require("../../base/BaseEvent"); const BaseEvent = require("../../base/BaseEvent");
const { AuditLogEvent } = require("discord.js");
class messageDelete extends BaseEvent { class messageDelete extends BaseEvent {
constructor() { constructor() {
@ -24,7 +25,7 @@ class messageDelete extends BaseEvent {
const logs = await message.guild.fetchAuditLogs({ const logs = await message.guild.fetchAuditLogs({
limit: 5, limit: 5,
type: "MESSAGE_DELETE", type: AuditLogEvent.MessageDelete,
}); });
const deletedMessage = logs.entries.find(e => e.targetId === message.author.id && e.extra.channel.id && Date.now() - e.createdTimestamp < 20000); const deletedMessage = logs.entries.find(e => e.targetId === message.author.id && e.extra.channel.id && Date.now() - e.createdTimestamp < 20000);