Slash commands order of choices should be respected
I seems like the order of choices in the api request is ignored, and the choices are ordered alphabetically.
url = "https://discord.com/api/v8/applications/<my_application_id>/commands" json = { "name": "blep", "description": "Send a random adorable animal photo", "options": [ { "name": "animal", "description": "The type of animal", "type": 3, "required": True, "choices": [ { "name": "Dog", "value": "animal_dog" }, { "name": "Cat", "value": "animal_cat" }, { "name": "Penguin", "value": "animal_penguin" } ] }, { "name": "only_smol", "description": "Whether to show only baby animals", "type": 5, "required": False } ] }
Should result in a choice list in the order of "Dog", "Cat", "Penguin".
Right now it's re-ordered in alphabetical order.
If the bot creator wanted the list in alphabetical order, they would have provided them in alphabetical order. I see no point in removing this option.
My work around is:
url = "https://discord.com/api/v8/applications/<my_application_id>/commands" json = { "name": "blep", "description": "Send a random adorable animal photo", "options": [ { "name": "animal", "description": "The type of animal", "type": 3, "required": True, "choices": [ { "name": "1. Dog", "value": "animal_dog" }, { "name": "2. Cat", "value": "animal_cat" }, { "name": "3. Penguin", "value": "animal_penguin" } ] }, { "name": "only_smol", "description": "Whether to show only baby animals", "type": 5, "required": False } ] }
4
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare