Ararou - Is this smth fixable? It's never done thi...

Is this smth fixable? It's never done this before and I don't know whats causing it.
26 Replies
kyra
kyra3y ago
Use util.inspect on your errors to get more information about them
Favna
Favna3y ago
Other than that, how many fields are you adding? It coming from addFields suggests to me you're exceeding the maximum field count
ararou!
ararou!OP3y ago
f (Array.isArray(Array2) && Array2.length) { pages.setItems([ Array2.map and im doing pages.setItemsPerPage(20); pages.setIdle(120000); pages.make();
Favna
Favna3y ago
Fields not items. Fields in the embed. Also that code means nothing.
ararou!
ararou!OP3y ago
the maxium of fields it should add before starting a new page is 20
Favna
Favna3y ago
pages.make()? So you're not using the base class of Paginated message.
ararou!
ararou!OP3y ago
ive been using pages.make() when i started out and never has had any issues
Favna
Favna3y ago
The base class is PaginatedMessage, not PaginatedMessageEmbedFields Pretty sure @kaname-png wrote PaginatedMessageEmbedFields Personally never used it
ararou!
ararou!OP3y ago
so should i just use the base class
Favna
Favna3y ago
The only difference is that PaginatedMessageEmbedFields only paginates the embed fields and doesn't let you change the title per page for example.
ararou!
ararou!OP3y ago
ah so its nearly the same
Favna
Favna3y ago
That's kind of the definition of a base and extension. It extends the base class.
ararou!
ararou!OP3y ago
and also yea i did util.inspect and it said
ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value

Expected: expected <= 25

Received:
| 26
ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value

Expected: expected <= 25

Received:
| 26
Favna
Favna3y ago
So yeah too many fields If you're using an editor that shows intellisense when hovering over classes (I.e. vscode) then plenty of docs should show up when hovering over classes and methods.
ararou!
ararou!OP3y ago
so how do i set the template now using PaginatedMessage
Favna
Favna3y ago
Which includes examples
ararou!
ararou!OP3y ago
im not since i dont have a pc
Favna
Favna3y ago
Oh no don't tell me you're one of those people who codes on phone At least use GitHub codespaces or vscode server if you do You're really making it way way harder for yourself
ararou!
ararou!OP3y ago
i dont have enough money to get a pc so i have to use my phone + my old keyboard and mouse
Favna
Favna3y ago
Well then get used to browse the source code which also documents the examples https://github.com/sapphiredev/utilities/blob/7fb7d2c/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessage.ts (Our website would too if typedoc didn't suck and/or the rewrite would ever finish but I digress)
GitHub
utilities/PaginatedMessage.ts at 7fb7d2c2727c04d38fa428c4513b17784c...
Common JavaScript utilities for Sapphire Projects. Contribute to sapphiredev/utilities development by creating an account on GitHub.
ararou!
ararou!OP3y ago
im alr lookin at that lol
Favna
Favna3y ago
And there's also many sapphire bots that you can look at:
Spinel
Spinel3y ago
Discord bots that use @sapphire/[email protected] and leverage Application Commands and Interaction Handlers - Official Bot Examples ᴱ ᴰ ᴶˢ - Archangel ᴱ ᴰ - Arima ᴱ - Dragonite ᴱ ᴰ - Nino ᴱ ᴰ - Operator ᴱ ᴬ ᴰ - Radon ᴱ ᴬ - Sapphire Application Commands Examples ᴱ - Spectera ᴬ Discord bots that use @sapphire/framework v2 - Materia ᴱ - RTByte ᴱ ᴬ - Skyra ᴬ ᴰ - YliasDiscordBot ᴬ : Uses ESM (if not specified then uses CJS) : Advanced bot (if not specified it is a simple bot, or not graded) : Uses Docker in production ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
ararou!
ararou!OP3y ago
just idk why its not working now since my v13 source works well Yep @Favna I think downgrading to v13 fixed it. Now it actually paginates the embed.
Favna
Favna3y ago
V13 of djs? Yeah sapphire doesn't support v14 yet.
ararou!
ararou!OP3y ago
ya the alpha just breaks stuff ig
Want results from more Discord servers?
Add your server