Skip to content

Conversation

typpo
Copy link
Contributor

@typpo typpo commented Sep 14, 2021

No description provided.

Copy link
Contributor

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

| required? | boolean | if the parameter is required or optional--default `false` |
| choices? | array of [application command option choice](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-object-application-command-option-choice-structure) | choices for `STRING`, `INTEGER`, and `NUMBER` types for the user to pick from, max 25 |
| options? | array of [application command option](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-object-application-command-option-structure) | if the option is a subcommand or subcommand group type, this nested options will be the parameters |
| channel_types? | array of [channel types](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) | if the option is a channel type, the channels shown will be restricted to these types |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are empty arrays treated weirdly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you provide an empty array it will just use all channel types (at least from my testing that's what happened)

@Lulalaby
Copy link
Contributor

image
:3

@ckohen
Copy link
Contributor

ckohen commented Sep 15, 2021

It seems passing a non-integer value attempts to coerce the value into an integer, and when that fails we get this error as expected.
image

However, a value of true would be converted to 1.

Furthermore, when sending null or undefined, it will set the type to be null (which is not documented as a valid type) and no channels will ever appear, preventing the command from being sent.

@Lulalaby
Copy link
Contributor

it works in my lib when I set it null and ignore null on transmit.
So don't submit it if it's not given

@ckohen
Copy link
Contributor

ckohen commented Sep 15, 2021

Oh whoops, should've specified, I meant sending null as an array value, not null as the value of the key itself

Picture for further clarification of received data:
image

@quirky-bluejay
Copy link
Contributor

Is this validated by the api or is it just client side?

@advaith1
Copy link
Member

validated by the API (it's already live)

@sebm253
Copy link
Contributor

sebm253 commented Sep 19, 2021

#3825 (comment) is this intended?

@devsnek
Copy link
Contributor

devsnek commented Sep 19, 2021

yes

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.

10 participants