PaginatedMessage extended with editing the select menu options does not work as expected
I am readjusting certain things from my old class to that of @sapphire/discord.js-utilises I have noticed that my old class works as expected but this one does not, it adds another option and if I click it it gives an error
new method for the current class:
https://srcb.in/Hr0PPd6c7U
old method for the old class:
https://srcb.in/RZsP4GHSwV
I can't understand what's wrong
13 Replies
if you want, I'll send the new and old class
send the error
this error I already know
If it's the map causing issues
Then you are likely trying to access an item that doesn't exist
I am sending you an image and of the unexpected thing
that last option should not come out
I expect as behaviour that if the total number of pages that would be this.pages is greater than 10 it will split it into chunked arrays and add an option to pass the next chunked array as long as it is possible to pass the next chunked array
It's hard to say without the rest of the file to give context
do you want both files?
just the new one will do
Here
Try replacing
this.genaratedOptions.length > 10
with GenOptions > SubPage + 2
Without actually executing it's hard to say precisely what it's doing but if you try comparing GenOptions
and SubPage
it might be more consistentI managed to fix the issue