2022-11-15 09:06:18 -05:00
|
|
|
import Discord from 'discord.js';
|
2023-01-27 21:33:55 -05:00
|
|
|
import TClient from '../client';
|
2022-11-15 09:06:18 -05:00
|
|
|
export default {
|
2023-03-05 05:04:10 -05:00
|
|
|
run(client:TClient, msg:Discord.Message){
|
|
|
|
if (!client.config.botSwitches.logs) return;
|
|
|
|
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
|
2023-03-24 18:47:18 -04:00
|
|
|
const disabledChannels = [ '548032776830582794', '541677709487505408', '949380187668242483']
|
2023-03-05 05:04:10 -05:00
|
|
|
if (msg.guild?.id != client.config.mainServer.id || msg.partial || msg.author.bot || disabledChannels.includes(msg.channelId)) return;
|
|
|
|
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setAuthor({name: `Author: ${msg.author.tag} (${msg.author.id})`, iconURL: `${msg.author.displayAvatarURL()}`}).setTitle('Message deleted').setDescription(`<@${msg.author.id}>\n\`${msg.author.id}\``);
|
|
|
|
if (msg.content.length != 0) embed.addFields({name: 'Content', value: `\`\`\`\n${msg.content.slice(0,1000)}\n\`\`\``});
|
|
|
|
embed.addFields(
|
|
|
|
{ name: 'Channel', value: `<#${msg.channelId}>` },
|
|
|
|
{ name: 'Sent at', value: `<t:${Math.round(msg.createdTimestamp/1000)}>\n<t:${Math.round(msg.createdTimestamp/1000)}:R>` }
|
|
|
|
)
|
|
|
|
const attachments: Array<string> = [];
|
|
|
|
msg.attachments.forEach((x) => attachments.push(x.url));
|
|
|
|
channel.send({embeds: [embed], files: attachments})
|
|
|
|
}
|
2022-11-25 04:29:26 -05:00
|
|
|
}
|