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
I'm pretty sure there's a
setMaxValue()
on the slash command option builder?Yes but it only takes a number as a parameter
Actually
What else are you looking for?
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
If it's a reasonably low number, you could always mess around with auto complete
For dynamic choices
Depending on the context
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
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
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>
You can use
LazyPaginatedMessage
, which will asynchronously load every page only on demand