mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix(SlashCommandBuilder): missing methods in subcommand builder (#8583)
This commit is contained in:
@@ -371,6 +371,18 @@ describe('Slash Commands', () => {
|
|||||||
).not.toThrowError();
|
).not.toThrowError();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('GIVEN builder with subcommand THEN has regular slash command fields', () => {
|
||||||
|
expect(() =>
|
||||||
|
getBuilder()
|
||||||
|
.setName('name')
|
||||||
|
.setDescription('description')
|
||||||
|
.addSubcommand((option) => option.setName('ye').setDescription('ye'))
|
||||||
|
.addSubcommand((option) => option.setName('no').setDescription('no'))
|
||||||
|
.setDMPermission(false)
|
||||||
|
.setDefaultMemberPermissions(1n),
|
||||||
|
).not.toThrowError();
|
||||||
|
});
|
||||||
|
|
||||||
test('GIVEN builder with already built subcommand group THEN does not throw error', () => {
|
test('GIVEN builder with already built subcommand group THEN does not throw error', () => {
|
||||||
expect(() => getNamedBuilder().addSubcommandGroup(getSubcommandGroup())).not.toThrowError();
|
expect(() => getNamedBuilder().addSubcommandGroup(getSubcommandGroup())).not.toThrowError();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -190,8 +190,7 @@ export class SlashCommandBuilder {
|
|||||||
export interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}
|
export interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}
|
||||||
|
|
||||||
export interface SlashCommandSubcommandsOnlyBuilder
|
export interface SlashCommandSubcommandsOnlyBuilder
|
||||||
extends SharedNameAndDescription,
|
extends Omit<SlashCommandBuilder, Exclude<keyof SharedSlashCommandOptions, 'options'>> {}
|
||||||
Pick<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup' | 'toJSON'> {}
|
|
||||||
|
|
||||||
export interface SlashCommandOptionsOnlyBuilder
|
export interface SlashCommandOptionsOnlyBuilder
|
||||||
extends SharedNameAndDescription,
|
extends SharedNameAndDescription,
|
||||||
|
|||||||
Reference in New Issue
Block a user