fedimbed: indentation moment

This commit is contained in:
Cynthia Foxwell 2023-11-29 01:59:38 -07:00
parent c7f16cf501
commit c031f23a53
1 changed files with 23 additions and 31 deletions

View File

@ -716,40 +716,34 @@ async function processUrl(msg, url, spoiler = false) {
description: attachment.desc, description: attachment.desc,
}); });
} }
}
logger.verbose("fedimbed", `Embeds should be 0: ${embeds.length}`); if (images.length <= 14) {
const fourteen = images.slice(10, 14);
if (images.length <= 14) { for (const attachment of fourteen) {
const fourteen = images.slice(10, 14); const embed = Object.assign({}, baseEmbed);
embed.image = {
for (const attachment of fourteen) { url: attachment.url,
const embed = Object.assign({}, baseEmbed);
embed.image = {
url: attachment.url,
};
embeds.push(embed);
}
}
logger.verbose("fedimbed", `Embeds should be 1-4: ${embeds.length}`);
if (images.length <= 18) {
const eighteen = images.slice(14, 18);
const _embed = {
url: baseEmbed.url + "?_",
title: "Additional Images",
}; };
embeds.push(embed);
for (const attachment of eighteen) {
const embed = Object.assign({}, _embed);
embed.image = {
url: attachment.url,
};
embeds.push(embed);
}
} }
}
logger.verbose("fedimbed", `Embeds should be 5-8: ${embeds.length}`); if (images.length <= 18) {
const eighteen = images.slice(14, 18);
const _embed = {
url: baseEmbed.url + "?_",
title: "Additional Images",
};
for (const attachment of eighteen) {
const embed = Object.assign({}, _embed);
embed.image = {
url: attachment.url,
};
embeds.push(embed);
}
} }
} }
} else { } else {
@ -823,8 +817,6 @@ async function processUrl(msg, url, spoiler = false) {
} }
} }
logger.verbose("fedimbed", `Embed count: ${embeds.length}`);
await msg.channel await msg.channel
.createMessage({ .createMessage({
content: content: