fix: Allow mixing subcommands with subcommand groups (#11303)

fix: allow subcommand with groups

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2025-11-30 16:48:19 +00:00
committed by GitHub
parent 8162ae8ce0
commit a57b4d4d29
2 changed files with 31 additions and 2 deletions

View File

@@ -376,6 +376,29 @@ describe('ChatInput Commands', () => {
});
});
describe('Subcommand builder and subcommand group builder', () => {
test('GIVEN both types THEN does not throw error', () => {
expect(() =>
getBuilder()
.setName('test')
.setDescription('Test command')
.addSubcommands((subcommand) =>
subcommand.setName('subcommand').setDescription('Description of subcommand'),
)
.addSubcommandGroups((subcommandGroup) =>
subcommandGroup
.setName('group')
.setDescription('Description of group')
.addSubcommands((subcommand) =>
subcommand.setName('subcommand').setDescription('Description of group subcommand'),
),
)
.toJSON(),
).not.toThrowError();
});
});
describe('ChatInput command localizations', () => {
const expectedSingleLocale = { [Locale.EnglishUS]: 'foobar' };
const expectedMultipleLocales = {