refactor: move full validation to ChatInputCommandBuilder (#11304)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2026-01-16 16:54:51 +00:00
committed by GitHub
parent be78e26729
commit 017176926a
9 changed files with 113 additions and 71 deletions

View File

@@ -379,21 +379,9 @@ 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'),
),
)
getNamedBuilder()
.addSubcommands(getSubcommand())
.addSubcommandGroups(getSubcommandGroup().addSubcommands(getSubcommand()))
.toJSON(),
).not.toThrowError();
});