discord-api-docs
discord-api-docs copied to clipboard
interactionCreate should send _hoistedOptions in order
Description
Currently, if you input multiple options while using a slash command, it doesn't matter what order you specify them, _hoistedOptions will ALWAYS output the options in the same order you created them in the SlashCommandBuilder.
Steps to Reproduce
- I have a command named
/create
with optionsname
,cost
, andtype
. Each of these is optional. - I run the command
/create type:Food cost:45
- Log the output of interaction.options._hoistedOptions
- Notice the
cost
option in the array shows up beforetype
option, even though I "sent"type
option first.
Expected Behavior
the returned options in the array should be in the order the user specifies when running the command.
Current Behavior
The returned options in the array are in the order specified in the SlashCommandBuilder.
Screenshots/Videos
Reviewing the command, pressing the up-arrow to get previous command, and/or logging the output of the options the bot receives shows that they are now in the wrong order.
Client and System Information
using Discordjs
This is a problem because the order of options is critical to my bot's function. I create 1 long string out of everything given, and the option that gets appended to the end is important. If it's always in the same order, my system does not work.
Context:
I run a neuralnetwork and use these options to build a "primetext" to feed into it. Whatever is at the end of the primetext, the NN then continues off of it.
Stable option ordering is not supported by the API at this time :)