fedimbed: me when i forget how logic

This commit is contained in:
Cynthia Foxwell 2023-11-29 02:14:05 -07:00
parent 13fd5a9899
commit a8a95f33a5

View file

@ -724,7 +724,15 @@ async function processUrl(msg, url, spoiler = false) {
if (images.length <= 14) {
const fourteen = images.slice(10, 14);
logger.verbose("fedimbed", `fourteen: $(fourteen.length}`);
for (const attachment of fourteen) {
const embed = Object.assign({}, baseEmbed);
embed.image = {
url: attachment.url,
};
embeds.push(embed);
}
} else if (images.length <= 18) {
const fourteen = images.slice(10, 14);
for (const attachment of fourteen) {
const embed = Object.assign({}, baseEmbed);
@ -732,11 +740,8 @@ async function processUrl(msg, url, spoiler = false) {
url: attachment.url,
};
embeds.push(embed);
logger.verbose("fedimbed", "mlem");
}
}
if (images.length <= 18) {
const eighteen = images.slice(14, 18);
const _embed = {
color: baseEmbed.color,