for (const attachment of attachments) {
const fileType = attachment.contentType.split('/')[0];
if (fileType == 'image') {
const newAttachment = new AttachmentBuilder(attachment.url, { name: attachment.name });
const imageEmbed = new EmbedBuilder()
.setColor('ff2a2a')
.setImage(`attachment://${newAttachment.name}`)
logChannel.send({ embeds: [imageEmbed], files: [newAttachment] });
}
}
for (const attachment of attachments) {
const fileType = attachment.contentType.split('/')[0];
if (fileType == 'image') {
const newAttachment = new AttachmentBuilder(attachment.url, { name: attachment.name });
const imageEmbed = new EmbedBuilder()
.setColor('ff2a2a')
.setImage(`attachment://${newAttachment.name}`)
logChannel.send({ embeds: [imageEmbed], files: [newAttachment] });
}
}