diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index bbbb602..bcb7ac5 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -240,7 +240,7 @@ async function processUrl(msg, url) { let desc = ""; let MAX_LENGTH = 3999; - if (cw != "") { + if (cw != "" && attachments.length == 0) { desc += "\u26a0 " + cw + "\n\n||" + content + "||"; MAX_LENGTH -= 8 - cw.length; } else { @@ -288,6 +288,7 @@ async function processUrl(msg, url) { const embeds = []; + if (attachments.length > 0) { for (const attachment of attachments) { const embed = Object.assign({}, baseEmbed); embed.image = { @@ -295,6 +296,9 @@ async function processUrl(msg, url) { }; embeds.push(embed); } + } else { + embeds.push(baseEmbed); + } // NB: OceanicJS/Oceanic#32 //await msg.edit({flags: MessageFlags.SUPPRESS_EMBEDS}).catch(() => {}); @@ -309,6 +313,7 @@ async function processUrl(msg, url) { .catch(() => {}); await msg.channel.createMessage({ + content: cw && attachments.length > 0 ? ":warning: " + cw + " || ||"; embeds, allowedMentions: { repliedUser: false,