types(StringSelectMenuComponentData): options is required (#9515)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2023-05-05 13:28:39 +01:00
committed by GitHub
parent 166c961261
commit d7b18f0681
2 changed files with 3 additions and 3 deletions

View File

@@ -5857,7 +5857,7 @@ export interface BaseSelectMenuComponentData extends BaseComponentData {
export interface StringSelectMenuComponentData extends BaseSelectMenuComponentData { export interface StringSelectMenuComponentData extends BaseSelectMenuComponentData {
type: ComponentType.StringSelect; type: ComponentType.StringSelect;
options?: SelectMenuComponentOptionData[]; options: SelectMenuComponentOptionData[];
} }
export interface UserSelectMenuComponentData extends BaseSelectMenuComponentData { export interface UserSelectMenuComponentData extends BaseSelectMenuComponentData {

View File

@@ -1160,7 +1160,7 @@ client.on('guildCreate', async g => {
new ButtonBuilder(), new ButtonBuilder(),
{ type: ComponentType.Button, style: ButtonStyle.Primary, label: 'string', customId: 'foo' }, { type: ComponentType.Button, style: ButtonStyle.Primary, label: 'string', customId: 'foo' },
{ type: ComponentType.Button, style: ButtonStyle.Link, label: 'test', url: 'test' }, { type: ComponentType.Button, style: ButtonStyle.Link, label: 'test', url: 'test' },
{ type: ComponentType.StringSelect, customId: 'foo' }, { type: ComponentType.StringSelect, customId: 'foo', options: [{ label: 'label', value: 'value' }] },
new StringSelectMenuBuilder(), new StringSelectMenuBuilder(),
// @ts-expect-error // @ts-expect-error
{ type: ComponentType.TextInput, style: TextInputStyle.Paragraph, customId: 'foo', label: 'test' }, { type: ComponentType.TextInput, style: TextInputStyle.Paragraph, customId: 'foo', label: 'test' },
@@ -1174,7 +1174,7 @@ client.on('guildCreate', async g => {
components: [ components: [
{ type: ComponentType.Button, style: ButtonStyle.Primary, label: 'string', customId: 'foo' }, { type: ComponentType.Button, style: ButtonStyle.Primary, label: 'string', customId: 'foo' },
{ type: ComponentType.Button, style: ButtonStyle.Link, label: 'test', url: 'test' }, { type: ComponentType.Button, style: ButtonStyle.Link, label: 'test', url: 'test' },
{ type: ComponentType.StringSelect, customId: 'foo' }, { type: ComponentType.StringSelect, customId: 'foo', options: [{ label: 'label', value: 'value' }] },
], ],
}); });