Message Components Disappearing?

I have the weirdest issue. I'm using pagination from @sapphire/discord.js-utilities, but sometimes message components don't show up (although you can see "1/2" in the footer, and there are definitely supposed to be 2 pages). Example in the first image. But then I found some matrix shit, because I took the second image as a screenshot (with message components) 5 hours ago. I check the message now, and the components disappeared, without leaving a (edited) label behind (see third image). ???
3 Replies
Lioness100
Lioness100OP•2y ago
And this isn't happening consistently. Sometimes it works fine The only thing I'm doing abnormally is directly pushing to <PaginatedMessage>.pages instead of using #addPageEmbed(), but again, half of the time it works fine that way Code is as follows:
const handler = new PaginatedMessage({ template: embed });

await Promise.all(
categoryNames.map(async (name) => {
const products = await getDerivations(pages, name, creator ?? undefined, count ?? undefined);

for (const [chunkedIdx, chunked] of chunk(Object.entries(products), 10).entries()) {
const display = chunked
.map(([href, { count, title }], idx) => `#${idx + 1 + chunkedIdx * 10} - [${title}](${href}) (\`${count}\`)`)
.join('\n');

((handler.pages[chunkedIdx] as PaginatedMessageMessageOptionsUnion) ??= { embeds: [] }).embeds!.push(
new MessageEmbed()
.setTitle(`Page ${chunkedIdx + 1} - Performance Rankings (${name}) (${pages ?? 20} Pages) (Top ${count ?? 20})`)
.setDescription(display)
);
}
})
);

return handler.run(interaction);
const handler = new PaginatedMessage({ template: embed });

await Promise.all(
categoryNames.map(async (name) => {
const products = await getDerivations(pages, name, creator ?? undefined, count ?? undefined);

for (const [chunkedIdx, chunked] of chunk(Object.entries(products), 10).entries()) {
const display = chunked
.map(([href, { count, title }], idx) => `#${idx + 1 + chunkedIdx * 10} - [${title}](${href}) (\`${count}\`)`)
.join('\n');

((handler.pages[chunkedIdx] as PaginatedMessageMessageOptionsUnion) ??= { embeds: [] }).embeds!.push(
new MessageEmbed()
.setTitle(`Page ${chunkedIdx + 1} - Performance Rankings (${name}) (${pages ?? 20} Pages) (Top ${count ?? 20})`)
.setDescription(display)
);
}
})
);

return handler.run(interaction);
Doesn't look pretty because I'm writing it for someone who's not gonna read it 😎 the matrix shit just happened again I'm freaking out The components are literally vanishing?? if y'all don't know a solution at least tell me that i'm not going crazy
24
24•2y ago
is it timing out?!
Lioness100
Lioness100OP•2y ago
What do you mean?
Want results from more Discord servers?
Add your server