feat(APIApplicationCommand): add missing localization props (#383)

This commit is contained in:
Suneet Tipirneni
2022-03-29 14:31:09 -04:00
committed by GitHub
parent 25677fff43
commit 9c12718163
10 changed files with 78 additions and 6 deletions

View File

@@ -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>>;

View File

@@ -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
*/
@@ -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
*/

View File

@@ -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
*/
@@ -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
*/

View File

@@ -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'
>
>;
/**

View File

@@ -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'
>
>;
/**

View File

@@ -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>>;

View File

@@ -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
*/
@@ -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
*/

View File

@@ -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
*/
@@ -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
*/

View File

@@ -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'
>
>;
/**

View File

@@ -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'
>
>;
/**