revert that

This commit is contained in:
Jonny_Bro (Nikita) 2024-07-17 21:03:08 +05:00
parent e4ac2624ae
commit 66c4af9ac5
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
4 changed files with 4 additions and 13 deletions

View file

@ -21,22 +21,13 @@ class messageDelete extends BaseEvent {
const guildData = message.data.guild; const guildData = message.data.guild;
if (guildData.plugins?.monitoring?.messageDelete) { if (guildData.plugins?.monitoring?.messageDelete) {
await client.wait(1000);
const logs = await message.guild.fetchAuditLogs({
limit: 5,
type: AuditLogEvent.MessageDelete,
});
const deletedMessage = logs.entries.find(e => e.targetId === message.author.id && e.extra.channel.id && Date.now() - e.createdTimestamp < 20000);
const embed = client.embed({ const embed = client.embed({
author: { author: {
name: message.author.getUsername(), name: message.author.getUsername(),
iconURL: message.author.displayAvatarURL(), iconURL: message.author.displayAvatarURL(),
}, },
title: message.translate("misc:MONITORING:DELETE:TITLE", { user: message.author.getUsername() }), title: message.translate("misc:MONITORING:DELETE:TITLE", { user: message.author.getUsername() }),
description: message.translate("misc:MONITORING:DELETE:DESCRIPTION", { deletedBy: deletedMessage.executor ? deletedMessage.executor.toString() : "Unknown", content: message.content, channel: message.channel.toString(), time: `<t:${Math.floor(message.createdTimestamp / 1000)}:f>` }), description: message.translate("misc:MONITORING:DELETE:DESCRIPTION", { content: message.content, channel: message.channel.toString(), time: `<t:${Math.floor(message.createdTimestamp / 1000)}:f>` }),
}); });
message.guild.channels.cache.get(guildData.plugins.monitoring.messageDelete).send({ message.guild.channels.cache.get(guildData.plugins.monitoring.messageDelete).send({

View file

@ -24,7 +24,7 @@
"MONITORING": { "MONITORING": {
"DELETE": { "DELETE": {
"TITLE": "{{user}} deleted a message!", "TITLE": "{{user}} deleted a message!",
"DESCRIPTION": "Deleted by: {{deletedBy}}\nMessage content was: ```{{content}}```\nChannel: {{channel}}\nTime created: {{time}}" "DESCRIPTION": "Message content was: ```{{content}}```\nChannel: {{channel}}\nTime created: {{time}}"
}, },
"UPDATE": { "UPDATE": {
"TITLE": "{{user}} updated a message!", "TITLE": "{{user}} updated a message!",

View file

@ -24,7 +24,7 @@
"MONITORING": { "MONITORING": {
"DELETE": { "DELETE": {
"TITLE": "{{user}} удалил сообщение!", "TITLE": "{{user}} удалил сообщение!",
"DESCRIPTION": "Удалил: {{deletedBy}}\nСодержимое сообщения было: ```{{content}}```\nКанал: {{channel}}\nВремя создания: {{time}}" "DESCRIPTION": "Содержимое сообщения было: ```{{content}}```\nКанал: {{channel}}\nВремя создания: {{time}}"
}, },
"UPDATE": { "UPDATE": {
"TITLE": "{{user}} обновил сообщение!", "TITLE": "{{user}} обновил сообщение!",

View file

@ -24,7 +24,7 @@
"MONITORING": { "MONITORING": {
"DELETE": { "DELETE": {
"TITLE": "{{user}} видалив повідомлення!", "TITLE": "{{user}} видалив повідомлення!",
"DESCRIPTION": "Видалив: {{deletedBy}}\nВміст повідомлення було: ```{{content}}```\nКанал: {{channel}}\nЧас створення: {{time}}" "DESCRIPTION": "Вміст повідомлення було: ```{{content}}```\nКанал: {{channel}}\nЧас створення: {{time}}"
}, },
"UPDATE": { "UPDATE": {
"TITLE": "{{user}} оновив повідомлення!", "TITLE": "{{user}} оновив повідомлення!",