1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 16:30:59 -04:00

temporary workaround until theres a fix for invalidated images

This commit is contained in:
AnxietyisReal 2022-11-26 07:05:41 +11:00
parent af9e2d37f6
commit 833e16412b

View File

@ -11,9 +11,8 @@ export default {
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}>\nContent:\n\`\`\`\n${msg?.content}\n\`\`\`\nChannel: <#${msg.channelId}>`) 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}>\nContent:\n\`\`\`\n${msg?.content}\n\`\`\`\nChannel: <#${msg.channelId}>`)
let image; let image;
if (msg.attachments?.first()?.width && ['png', 'jpeg', 'jpg', 'gif', 'webp'].some(x=>((msg.attachments.first() as Discord.Attachment).name as string).endsWith(x))) { if (msg.attachments?.first()?.width && ['png', 'jpeg', 'jpg', 'gif', 'webp'].some(x=>((msg.attachments.first() as Discord.Attachment).name as string).endsWith(x))) {
image = msg.attachments?.first().proxyURL image = msg.attachments?.first().attachment
embed.setImage(image)
} }
channel.send({embeds: [embed]}) channel.send({embeds: [embed], files: [image]})
} }
} }