mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 16:30:58 -05:00
Sort of fix attachment errors
This commit is contained in:
parent
5972f4246b
commit
eb1b04bc42
@ -9,10 +9,8 @@ export default {
|
|||||||
if (msg.partial) return;
|
if (msg.partial) return;
|
||||||
if (msg.author.bot) return;
|
if (msg.author.bot) 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}>\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;
|
const attachments: Array<string> = [];
|
||||||
if (msg.attachments?.first()?.width && ['png', 'jpeg', 'jpg', 'gif', 'webp'].some(x=>((msg.attachments.first() as Discord.Attachment).name as string).endsWith(x))) {
|
msg.attachments.forEach((x) => attachments.push(x.url));
|
||||||
image = msg.attachments?.first().attachment
|
channel.send({embeds: [embed], files: attachments})
|
||||||
}
|
|
||||||
channel.send({embeds: [embed], files: [image]})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user