Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document slash command option type NUMBER (10) #3455

Merged
merged 4 commits into from
Jul 26, 2021

Conversation

advaith1
Copy link
Contributor

@advaith1 advaith1 commented Jul 16, 2021

currently only supported in canary client & API

Co-Authored-By: devsnek <[email protected]>
@Lulalaby
Copy link
Contributor

This is nice!

@Lulalaby
Copy link
Contributor

currently only supported in canary client & API

Does not work for me in canary client
image
But the bot is able to create the option choice via canary api.

@advaith1
Copy link
Contributor Author

cant reproduce, not sure what's going on there

@Lulalaby
Copy link
Contributor

On which build you tried?

Mine:

Canary 90350 (64f9f60)
Host 1.0.37
Windows 11

@advaith1
Copy link
Contributor Author

I used the same, on desktop and web
however that looks like an error coming from the API; maybe it's going to the stable API somehow?

@Lulalaby
Copy link
Contributor

Lulalaby commented Jul 18, 2021

Ah the bot submitted value null on every option type..

Seems to be an error on my side.

@Lulalaby
Copy link
Contributor

Lulalaby commented Jul 18, 2021

hmm, i looked into the registered commands and it should be right
but it submits value null on sending the selected option

    {
        "id": "865312750930493491",
        "application_id": "822242444070092860",
        "name": "volume",
        "description": "Modifies the volume",
        "version": "866326834736136244",
        "default_permission": true,
        "type": 1,
        "guild_id": "823210634237444159",
        "options": [
            {
                "type": 10,
                "name": "volume",
                "description": "Volume",
                "required": true,
                "choices": [
                    {
                        "name": "10%",
                        "value": 0.1
                    },
                    {
                        "name": "20%",
                        "value": 0.2
                    },
                    {
                        "name": "30%",
                        "value": 0.3
                    },
                    {
                        "name": "40%",
                        "value": 0.4
                    },
                    {
                        "name": "50%",
                        "value": 0.5
                    },
                    {
                        "name": "60%",
                        "value": 0.6
                    },
                    {
                        "name": "70%",
                        "value": 0.7
                    },
                    {
                        "name": "80%",
                        "value": 0.8
                    },
                    {
                        "name": "90%",
                        "value": 0.9
                    },
                    {
                        "name": "100%",
                        "value": 1.0
                    }
                ]
            }
        ]
    }

I even enabled in the developer tools forced canary for testing, but still does not work.

@Lulalaby
Copy link
Contributor

Request to: POST https://canary.discord.com/api/v9/interactions

{
   "type":2,
   "application_id":"822242444070092860",
   "guild_id":"823210634237444159",
   "channel_id":"865331165346660393",
   "data":{
      "version":"866326834736136244",
      "id":"865312750930493491",
      "guild_id":"823210634237444159",
      "name":"volume",
      "options":[
         {
            "type":10,
            "name":"volume",
            "value":null
         }
      ]
   },
   "nonce":"866328407040851968"
}

Response:

{
   "code":50035,
   "errors":{
      "data":{
         "options":{
            "0":{
               "value":{
                  "_errors":[
                     {
                        "code":"INTERACTION_APPLICATION_COMMAND_OPTIONS_VALUE_INVALID",
                        "message":"Application command interaction option values must be of type string, integer, or boolean"
                     }
                  ]
               }
            }
         }
      }
   },
   "message":"Invalid Form Body"
}

@typpo
Copy link
Contributor

typpo commented Jul 19, 2021

Not released yet and therefore the API is subject to change, will revisit once the feature is finalized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants