fix: slashcommand builder type split (#10253)

This commit is contained in:
Qjuh
2024-05-05 12:03:14 +02:00
committed by GitHub
parent 30d79e85fb
commit 07c12101e5
6 changed files with 135 additions and 112 deletions

View File

@@ -357,6 +357,10 @@ describe('Slash Commands', () => {
getBuilder().addStringOption(getStringOption().setChoices({ name: 'owo', value: 'uwu' })),
).not.toThrowError();
});
test('GIVEN valid builder with NSFW, THEN does not throw error', () => {
expect(() => getBuilder().setName('foo').setDescription('foo').setNSFW(true)).not.toThrowError();
});
});
describe('Builder with subcommand (group) options', () => {
@@ -519,6 +523,14 @@ describe('Slash Commands', () => {
expect(() => getBuilder().setDefaultMemberPermissions(1.1)).toThrowError();
});
test('GIVEN valid permission with options THEN does not throw error', () => {
expect(() =>
getBuilder().addBooleanOption(getBooleanOption()).setDefaultMemberPermissions('1'),
).not.toThrowError();
expect(() => getBuilder().addChannelOption(getChannelOption()).setDMPermission(false)).not.toThrowError();
});
});
});
});