diff --git a/packages/discord.js/src/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js index 319dc2b72..1f9d6d422 100644 --- a/packages/discord.js/src/structures/ApplicationCommand.js +++ b/packages/discord.js/src/structures/ApplicationCommand.js @@ -73,7 +73,7 @@ class ApplicationCommand extends Base { if ('name_localizations' in data) { /** * The name localizations for this command - * @type {?Object} + * @type {?LocalizationMap} */ this.nameLocalizations = data.name_localizations; } else { @@ -101,7 +101,7 @@ class ApplicationCommand extends Base { if ('description_localizations' in data) { /** * The description localizations for this command - * @type {?Object} + * @type {?LocalizationMap} */ this.descriptionLocalizations = data.description_localizations; } else { @@ -227,11 +227,11 @@ class ApplicationCommand extends Base { * @typedef {Object} ApplicationCommandData * @property {string} name The name of the command, must be in all lowercase if type is * {@link ApplicationCommandType.ChatInput} - * @property {Object} [nameLocalizations] The localizations for the command name + * @property {LocalizationMap} [nameLocalizations] The localizations for the command name * @property {string} description The description of the command, * if type is {@link ApplicationCommandType.ChatInput} or {@link ApplicationCommandType.PrimaryEntryPoint} * @property {boolean} [nsfw] Whether the command is age-restricted - * @property {Object} [descriptionLocalizations] The localizations for the command description, + * @property {LocalizationMap} [descriptionLocalizations] The localizations for the command description, * if type is {@link ApplicationCommandType.ChatInput} or {@link ApplicationCommandType.PrimaryEntryPoint} * @property {ApplicationCommandType} [type=ApplicationCommandType.ChatInput] The type of the command * @property {ApplicationCommandOptionData[]} [options] Options for the command @@ -253,9 +253,9 @@ class ApplicationCommand extends Base { * @typedef {Object} ApplicationCommandOptionData * @property {ApplicationCommandOptionType} type The type of the option * @property {string} name The name of the option - * @property {Object} [nameLocalizations] The name localizations for the option + * @property {LocalizationMap} [nameLocalizations] The name localizations for the option * @property {string} description The description of the option - * @property {Object} [descriptionLocalizations] The description localizations for the option + * @property {LocalizationMap} [descriptionLocalizations] The description localizations for the option * @property {boolean} [autocomplete] Whether the autocomplete interaction is enabled for a * {@link ApplicationCommandOptionType.String}, {@link ApplicationCommandOptionType.Integer} or * {@link ApplicationCommandOptionType.Number} option @@ -277,7 +277,7 @@ class ApplicationCommand extends Base { /** * @typedef {Object} ApplicationCommandOptionChoiceData * @property {string} name The name of the choice - * @property {Object} [nameLocalizations] The localized names for this choice + * @property {LocalizationMap} [nameLocalizations] The localized names for this choice * @property {string|number} value The value of the choice */ @@ -308,7 +308,7 @@ class ApplicationCommand extends Base { /** * Edits the localized names of this ApplicationCommand - * @param {Object} nameLocalizations The new localized names for the command + * @param {LocalizationMap} nameLocalizations The new localized names for the command * @returns {Promise} * @example * // Edit the name localizations of this command @@ -334,7 +334,7 @@ class ApplicationCommand extends Base { /** * Edits the localized descriptions of this ApplicationCommand - * @param {Object} descriptionLocalizations The new localized descriptions for the command + * @param {LocalizationMap} descriptionLocalizations The new localized descriptions for the command * @returns {Promise} * @example * // Edit the description localizations of this command @@ -550,10 +550,10 @@ class ApplicationCommand extends Base { * @typedef {Object} ApplicationCommandOption * @property {ApplicationCommandOptionType} type The type of the option * @property {string} name The name of the option - * @property {Object} [nameLocalizations] The localizations for the option name + * @property {LocalizationMap} [nameLocalizations] The localizations for the option name * @property {string} [nameLocalized] The localized name for this option * @property {string} description The description of the option - * @property {Object} [descriptionLocalizations] The localizations for the option description + * @property {LocalizationMap} [descriptionLocalizations] The localizations for the option description * @property {string} [descriptionLocalized] The localized description for this option * @property {boolean} [required] Whether the option is required * @property {boolean} [autocomplete] Whether the autocomplete interaction is enabled for a diff --git a/packages/discord.js/src/structures/ApplicationRoleConnectionMetadata.js b/packages/discord.js/src/structures/ApplicationRoleConnectionMetadata.js index 7ed9b33f3..138e4214f 100644 --- a/packages/discord.js/src/structures/ApplicationRoleConnectionMetadata.js +++ b/packages/discord.js/src/structures/ApplicationRoleConnectionMetadata.js @@ -13,7 +13,7 @@ class ApplicationRoleConnectionMetadata { /** * The name localizations for this metadata field - * @type {?Object} + * @type {?LocalizationMap} */ this.nameLocalizations = data.name_localizations ?? null; @@ -25,7 +25,7 @@ class ApplicationRoleConnectionMetadata { /** * The description localizations for this metadata field - * @type {?Object} + * @type {?LocalizationMap} */ this.descriptionLocalizations = data.description_localizations ?? null; diff --git a/packages/discord.js/src/structures/ClientApplication.js b/packages/discord.js/src/structures/ClientApplication.js index cc78d5adc..248ef78db 100644 --- a/packages/discord.js/src/structures/ClientApplication.js +++ b/packages/discord.js/src/structures/ClientApplication.js @@ -375,9 +375,9 @@ class ClientApplication extends Application { * Data for creating or editing an application role connection metadata. * @typedef {Object} ApplicationRoleConnectionMetadataEditOptions * @property {string} name The name of the metadata field - * @property {?Object} [nameLocalizations] The name localizations for the metadata field + * @property {?LocalizationMap} [nameLocalizations] The name localizations for the metadata field * @property {string} description The description of the metadata field - * @property {?Object} [descriptionLocalizations] The description localizations for the metadata field + * @property {?LocalizationMap} [descriptionLocalizations] The description localizations for the metadata field * @property {string} key The dictionary key of the metadata field * @property {ApplicationRoleConnectionMetadataType} type The type of the metadata field */ diff --git a/packages/discord.js/src/util/APITypes.js b/packages/discord.js/src/util/APITypes.js index ae9c35012..66f6a8f9e 100644 --- a/packages/discord.js/src/util/APITypes.js +++ b/packages/discord.js/src/util/APITypes.js @@ -540,6 +540,11 @@ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/Locale} */ +/** + * @external LocalizationMap + * @see {@link https://discord-api-types.dev/api/discord-api-types-v10#LocalizationMap} + */ + /** * @external MessageActivityType * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageActivityType}