Skip to content

Commit

Permalink
feat(ApplicationCommandOptionType): add Number (10) (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 committed Jul 26, 2021
1 parent d338409 commit 6f15e53
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
12 changes: 11 additions & 1 deletion deno/payloads/v8/_interactions/slashCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
* but they can have a `choices` one
*/
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
type:
| ApplicationCommandOptionType.String
| ApplicationCommandOptionType.Integer
| ApplicationCommandOptionType.Number;
choices?: APIApplicationCommandOptionChoice[];
}

Expand All @@ -96,6 +99,7 @@ export enum ApplicationCommandOptionType {
Channel,
Role,
Mentionable,
Number,
}

/**
Expand Down Expand Up @@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionNumber
| ApplicationCommandInteractionDataOptionBoolean;

export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
Expand Down Expand Up @@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
number
>;

export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
ApplicationCommandOptionType.Number,
number
>;

export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean
Expand Down
12 changes: 11 additions & 1 deletion deno/payloads/v9/_interactions/slashCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
* but they can have a `choices` one
*/
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
type:
| ApplicationCommandOptionType.String
| ApplicationCommandOptionType.Integer
| ApplicationCommandOptionType.Number;
choices?: APIApplicationCommandOptionChoice[];
}

Expand All @@ -96,6 +99,7 @@ export enum ApplicationCommandOptionType {
Channel,
Role,
Mentionable,
Number,
}

/**
Expand Down Expand Up @@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionNumber
| ApplicationCommandInteractionDataOptionBoolean;

export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
Expand Down Expand Up @@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
number
>;

export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
ApplicationCommandOptionType.Number,
number
>;

export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean
Expand Down
12 changes: 11 additions & 1 deletion payloads/v8/_interactions/slashCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
* but they can have a `choices` one
*/
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
type:
| ApplicationCommandOptionType.String
| ApplicationCommandOptionType.Integer
| ApplicationCommandOptionType.Number;
choices?: APIApplicationCommandOptionChoice[];
}

Expand All @@ -96,6 +99,7 @@ export const enum ApplicationCommandOptionType {
Channel,
Role,
Mentionable,
Number,
}

/**
Expand Down Expand Up @@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionNumber
| ApplicationCommandInteractionDataOptionBoolean;

export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
Expand Down Expand Up @@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
number
>;

export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
ApplicationCommandOptionType.Number,
number
>;

export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean
Expand Down
12 changes: 11 additions & 1 deletion payloads/v9/_interactions/slashCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
* but they can have a `choices` one
*/
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
type:
| ApplicationCommandOptionType.String
| ApplicationCommandOptionType.Integer
| ApplicationCommandOptionType.Number;
choices?: APIApplicationCommandOptionChoice[];
}

Expand All @@ -96,6 +99,7 @@ export const enum ApplicationCommandOptionType {
Channel,
Role,
Mentionable,
Number,
}

/**
Expand Down Expand Up @@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionNumber
| ApplicationCommandInteractionDataOptionBoolean;

export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
Expand Down Expand Up @@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
number
>;

export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
ApplicationCommandOptionType.Number,
number
>;

export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean
Expand Down

0 comments on commit 6f15e53

Please sign in to comment.