Set ApplicationCommandOption max value to be a function

For a "page" option in a command, I want to set the max value in the options rather than checking after the user run's the command. Is there any way to do this?
9 Replies
Lioness100
Lioness1002y ago
I'm pretty sure there's a setMaxValue() on the slash command option builder?
JcbSm
JcbSm2y ago
Yes but it only takes a number as a parameter Actually
Lioness100
Lioness1002y ago
What else are you looking for?
JcbSm
JcbSm2y ago
What I want wouldn't work it would mean constantly updating commands per-guild dw dw i'm being silly and OTT i'll just arg check after the command is ran
Lioness100
Lioness1002y ago
If it's a reasonably low number, you could always mess around with auto complete For dynamic choices Depending on the context
JcbSm
JcbSm2y ago
It's a page number for a leaderboard but each guild will have different max values and it will change as members come and go
Lioness100
Lioness1002y ago
Have you looked at pagination through @sapphire/discord.js-utilities? It by default provides a select menu with the embed where the user can pick a page Along with the standard arrow buttons
JcbSm
JcbSm2y ago
I'll have a look My onyl issue is, it takes ~2 to draw each page as I'm using canvas to make it look pretty Idk how that will work, but thanks anyway <a:Pepe_High_five_2:855394282508124182>
Lioness100
Lioness1002y ago
You can use LazyPaginatedMessage, which will asynchronously load every page only on demand