Skip to content

Commit

Permalink
feat(APIApplicationCommand): add missing localization props (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Mar 29, 2022
1 parent 25677ff commit 9c12718
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deno/payloads/common.ts
Expand Up @@ -57,4 +57,4 @@ export const PermissionFlagsBits = {
*/
Object.freeze(PermissionFlagsBits);

export type LocalizationMap = Partial<Record<LocaleString, string>>;
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
8 changes: 8 additions & 0 deletions deno/payloads/v10/_interactions/applicationCommands.ts
Expand Up @@ -50,6 +50,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
Expand All @@ -58,6 +62,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/
Expand Down
8 changes: 8 additions & 0 deletions deno/payloads/v9/_interactions/applicationCommands.ts
Expand Up @@ -50,6 +50,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
Expand All @@ -58,6 +62,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/
Expand Down
12 changes: 11 additions & 1 deletion deno/rest/v10/interactions.ts
Expand Up @@ -27,7 +27,17 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;

type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id'>
Omit<
APIApplicationCommand,
| 'id'
| 'application_id'
| 'description'
| 'type'
| 'version'
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
>;

/**
Expand Down
12 changes: 11 additions & 1 deletion deno/rest/v9/interactions.ts
Expand Up @@ -27,7 +27,17 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;

type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id'>
Omit<
APIApplicationCommand,
| 'id'
| 'application_id'
| 'description'
| 'type'
| 'version'
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
>;

/**
Expand Down
2 changes: 1 addition & 1 deletion payloads/common.ts
Expand Up @@ -57,4 +57,4 @@ export const PermissionFlagsBits = {
*/
Object.freeze(PermissionFlagsBits);

export type LocalizationMap = Partial<Record<LocaleString, string>>;
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
8 changes: 8 additions & 0 deletions payloads/v10/_interactions/applicationCommands.ts
Expand Up @@ -50,6 +50,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
Expand All @@ -58,6 +62,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/
Expand Down
8 changes: 8 additions & 0 deletions payloads/v9/_interactions/applicationCommands.ts
Expand Up @@ -50,6 +50,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
Expand All @@ -58,6 +62,10 @@ export interface APIApplicationCommand {
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/
Expand Down
12 changes: 11 additions & 1 deletion rest/v10/interactions.ts
Expand Up @@ -27,7 +27,17 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;

type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id'>
Omit<
APIApplicationCommand,
| 'id'
| 'application_id'
| 'description'
| 'type'
| 'version'
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
>;

/**
Expand Down
12 changes: 11 additions & 1 deletion rest/v9/interactions.ts
Expand Up @@ -27,7 +27,17 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;

type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id'>
Omit<
APIApplicationCommand,
| 'id'
| 'application_id'
| 'description'
| 'type'
| 'version'
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
>;

/**
Expand Down

0 comments on commit 9c12718

Please sign in to comment.