Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Components): new select menus #602

Merged
merged 9 commits into from
Oct 20, 2022
46 changes: 41 additions & 5 deletions deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,13 +1306,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined options
*/
SelectMenu,
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
StringSelect,
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,

// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //

/**
* Select menu for picking from defined options
*
* @deprecated This is the old name for {@apilink ChannelType#StringSelect}
*/
SelectMenu = 3,
}

/**
Expand Down Expand Up @@ -1404,15 +1429,26 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APISelectMenuComponent
extends APIBaseComponent<
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect
> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
custom_id: string;
/**
* The choices in the select, max 25
* Specified choices in a select menu (only required and available for StringSelect, max 25)
*/
options?: APISelectMenuOption[];
/**
* List of channel types to include in the ChannelSelect component
*/
options: APISelectMenuOption[];
channel_types?: ChannelType[];
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Custom placeholder text if nothing is selected, max 150 characters
*/
Expand Down
38 changes: 35 additions & 3 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1305,13 +1305,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined options
*/
SelectMenu,
StringSelect,
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,

// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //

/**
* Select menu for picking from defined options
*
* @deprecated This is the old name for {@apilink ChannelType#StringSelect}
*/
SelectMenu = 3,
}

/**
Expand Down Expand Up @@ -1403,7 +1428,14 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APISelectMenuComponent
extends APIBaseComponent<
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect
> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
Expand Down
46 changes: 41 additions & 5 deletions payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,13 +1306,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined options
*/
SelectMenu,
StringSelect,
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,

// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //

/**
* Select menu for picking from defined options
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
*
* @deprecated This is the old name for {@apilink ChannelType#StringSelect}
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
*/
SelectMenu = 3,
}

/**
Expand Down Expand Up @@ -1404,15 +1429,26 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APISelectMenuComponent
extends APIBaseComponent<
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect
> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
custom_id: string;
/**
* The choices in the select, max 25
* Specified choices in a select menu (only required and available for StringSelect, max 25)
*/
options?: APISelectMenuOption[];
/**
* List of channel types to include in the ChannelSelect component
*/
options: APISelectMenuOption[];
channel_types?: ChannelType[];
/**
* Custom placeholder text if nothing is selected, max 150 characters
*/
Expand Down
38 changes: 35 additions & 3 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1305,13 +1305,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined options
*/
SelectMenu,
StringSelect,
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,

// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //

/**
* Select menu for picking from defined options
*
* @deprecated This is the old name for {@apilink ChannelType#StringSelect}
*/
SelectMenu = 3,
}

/**
Expand Down Expand Up @@ -1403,7 +1428,14 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APISelectMenuComponent
extends APIBaseComponent<
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect
> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
Expand Down