Skip to content

SubcommandOption types have a required property #1510

Open

Description

@lisekilis

Issue description

try to use type APIApplicationCommandSubcommandOption or APIApplicationCommandSubcommandGroupOption

see that they have a required boolean property instead of being never
Discord Docs: https://discord.com/developers/docs/interactions/application-commands#:~:text=all%20but,SUB_COMMAND_GROUP

Image

Code sample

const testSubcommandOption: APIApplicationCommandSubcommandOption = {
	description: 'test',
	name: 'test',
	type: ApplicationCommandOptionType.Subcommand,
	options: [],
	required: true
}
const testSubcommandGroupOption: APIApplicationCommandSubcommandGroupOption = {
	name: 'testGroup',
	description: 'test group',
	type: ApplicationCommandOptionType.SubcommandGroup,
	options: [],
	required: false
}

Package version

0.38.38

Runtime

Node.js

Runtime version

v23.10.0

Priority this issue should have

Low (slightly annoying)

Activity

  1. Willfric commented on Aug 30, 2026

    @Willfric

    the issue is in APIApplicationCommandOptionBase — both subcommand types extend it and inherit required?: boolean even though discord's docs explicitly say subcommands and subcommand groups don't support it. straightforward fix is overriding it as required?: never on both interfaces. happy to pr if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions