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

fix(ApplicationCommand): return string equivalent of ApplicationCommandOptionType #5617

Merged
merged 1 commit into from May 14, 2021
Merged

fix(ApplicationCommand): return string equivalent of ApplicationCommandOptionType #5617

merged 1 commit into from May 14, 2021

Conversation

JKLorenzo
Copy link
Contributor

@JKLorenzo JKLorenzo commented May 12, 2021

Please describe the changes this PR makes and why it should be merged:

Fixes the returned ApplicationCommandOption.type of child-options.

The current output of options:

ApplicationCommand.options = [
  {
    name: 'parent',
    description: 'parent description',
    type: 'SUB_COMMAND', // <-- Returns the string equivalent of the ApplicationCommandOptionType ✅
    options: [
      {
        name: 'child',
        description: 'child description',
        type: 6, // <-- Returns the raw API value of the ApplicationCommandOptionType ❌
      }
    ]
  }
]

The proposed output of options:

ApplicationCommand.options = [
  {
    name: 'parent',
    description: 'parent description',
    type: 'SUB_COMMAND',
    options: [
      {
        name: 'child',
        description: 'child description',
        type: 'USER',
      }
    ]
  }
]

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Note: This is my first time in contributing to the library so please go easy on me :)

@kyranet kyranet requested a review from SpaceEEC May 12, 2021 21:01
@iCrawl iCrawl merged commit a6079bc into discordjs:master May 14, 2021
@JKLorenzo JKLorenzo deleted the interactions branch May 15, 2021 00:46
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
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.

None yet

5 participants