discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

interactionCreate should send _hoistedOptions in order

Open CocoaMix86 opened this issue 1 year ago • 1 comments

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 options name, cost, and type. 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 before type 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

image

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.
image

Client and System Information

using Discordjs

CocoaMix86 avatar Aug 04 '22 12:08 CocoaMix86

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.

CocoaMix86 avatar Aug 04 '22 12:08 CocoaMix86

Stable option ordering is not supported by the API at this time :)

typpo avatar Dec 02 '22 18:12 typpo