From a5afc406b965b39a9cc90ef9e0e7a4b460c4e04c Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Wed, 28 Aug 2024 00:30:16 +0200 Subject: [PATCH 01/42] feat: super reactions (#9336) * feat: super reactions * docs: Touch-up * feat: count super reactions in events * feat: document me_burst property Co-authored-by: Danial Raza * feat: document type query for fetching reaction users * fix: cover case when burstColors can be undefined at init of a reaction * Update packages/discord.js/src/structures/MessageReaction.js Co-authored-by: Vlad Frangu * chore: futureproof so use an object --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Danial Raza Co-authored-by: Vlad Frangu Co-authored-by: Vlad Frangu --- .../src/client/actions/MessageReactionAdd.js | 12 +++- .../client/actions/MessageReactionRemove.js | 5 +- .../src/managers/ReactionUserManager.js | 7 ++- .../src/structures/MessageReaction.js | 61 ++++++++++++++++--- packages/discord.js/typings/index.d.ts | 26 +++++++- 5 files changed, 95 insertions(+), 16 deletions(-) diff --git a/packages/discord.js/src/client/actions/MessageReactionAdd.js b/packages/discord.js/src/client/actions/MessageReactionAdd.js index 6932358cf107..9c9ffbc874a0 100644 --- a/packages/discord.js/src/client/actions/MessageReactionAdd.js +++ b/packages/discord.js/src/client/actions/MessageReactionAdd.js @@ -9,6 +9,7 @@ const Partials = require('../../util/Partials'); message_id: 'id', emoji: { name: '�', id: null }, channel_id: 'id', + burst: boolean // If originating from a guild guild_id: 'id', member: { ..., user: { ... } } } @@ -36,17 +37,24 @@ class MessageReactionAdd extends Action { emoji: data.emoji, count: message.partial ? null : 0, me: user.id === this.client.user.id, + burst_colors: data.burst_colors, }); if (!reaction) return false; - reaction._add(user); + reaction._add(user, data.burst); if (fromStructure) return { message, reaction, user }; + /** + * Provides additional information about altered reaction + * @typedef {Object} MessageReactionEventDetails + * @property {boolean} burst Determines whether a super reaction was used + */ /** * Emitted whenever a reaction is added to a cached message. * @event Client#messageReactionAdd * @param {MessageReaction} messageReaction The reaction object * @param {User} user The user that applied the guild or reaction emoji + * @param {MessageReactionEventDetails} details Details of adding the reaction */ - this.client.emit(Events.MessageReactionAdd, reaction, user); + this.client.emit(Events.MessageReactionAdd, reaction, user, { burst: data.burst }); return { message, reaction, user }; } diff --git a/packages/discord.js/src/client/actions/MessageReactionRemove.js b/packages/discord.js/src/client/actions/MessageReactionRemove.js index 93874a777d26..5430a37c461e 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemove.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemove.js @@ -29,14 +29,15 @@ class MessageReactionRemove extends Action { // Verify reaction const reaction = this.getReaction(data, message, user); if (!reaction) return false; - reaction._remove(user); + reaction._remove(user, data.burst); /** * Emitted whenever a reaction is removed from a cached message. * @event Client#messageReactionRemove * @param {MessageReaction} messageReaction The reaction object * @param {User} user The user whose emoji or reaction emoji was removed + * @param {MessageReactionEventDetails} details Details of removing the reaction */ - this.client.emit(Events.MessageReactionRemove, reaction, user); + this.client.emit(Events.MessageReactionRemove, reaction, user, { burst: data.burst }); return { message, reaction, user }; } diff --git a/packages/discord.js/src/managers/ReactionUserManager.js b/packages/discord.js/src/managers/ReactionUserManager.js index 014cea8a3eae..c9a88be617be 100644 --- a/packages/discord.js/src/managers/ReactionUserManager.js +++ b/packages/discord.js/src/managers/ReactionUserManager.js @@ -2,7 +2,7 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); -const { Routes } = require('discord-api-types/v10'); +const { ReactionType, Routes } = require('discord-api-types/v10'); const CachedManager = require('./CachedManager'); const { DiscordjsError, ErrorCodes } = require('../errors'); const User = require('../structures/User'); @@ -31,6 +31,7 @@ class ReactionUserManager extends CachedManager { /** * Options used to fetch users who gave a reaction. * @typedef {Object} FetchReactionUsersOptions + * @property {ReactionType} [type=ReactionType.Normal] The reaction type to fetch * @property {number} [limit=100] The maximum amount of users to fetch, defaults to `100` * @property {Snowflake} [after] Limit fetching users to those with an id greater than the supplied id */ @@ -40,9 +41,9 @@ class ReactionUserManager extends CachedManager { * @param {FetchReactionUsersOptions} [options] Options for fetching the users * @returns {Promise>} */ - async fetch({ limit = 100, after } = {}) { + async fetch({ type = ReactionType.Normal, limit = 100, after } = {}) { const message = this.reaction.message; - const query = makeURLSearchParams({ limit, after }); + const query = makeURLSearchParams({ limit, after, type }); const data = await this.client.rest.get( Routes.channelMessageReaction(message.channelId, message.id, this.reaction.emoji.identifier), { query }, diff --git a/packages/discord.js/src/structures/MessageReaction.js b/packages/discord.js/src/structures/MessageReaction.js index 43f05e32b417..b6230bacb2ec 100644 --- a/packages/discord.js/src/structures/MessageReaction.js +++ b/packages/discord.js/src/structures/MessageReaction.js @@ -31,6 +31,12 @@ class MessageReaction { */ this.me = data.me; + /** + * Whether the client has super-reacted using this emoji + * @type {boolean} + */ + this.meBurst = data.me_burst; + /** * A manager of the users that have given this reaction * @type {ReactionUserManager} @@ -39,10 +45,20 @@ class MessageReaction { this._emoji = new ReactionEmoji(this, data.emoji); + this.burstColors = null; + this._patch(data); } _patch(data) { + if ('burst_colors' in data) { + /** + * Hexadecimal colors used for this super reaction + * @type {?string[]} + */ + this.burstColors = data.burst_colors; + } + if ('count' in data) { /** * The number of people that have given the same reaction @@ -50,6 +66,24 @@ class MessageReaction { */ this.count ??= data.count; } + + if ('count_details' in data) { + /** + * The reaction count details object contains information about super and normal reaction counts. + * @typedef {Object} ReactionCountDetailsData + * @property {number} burst Count of super reactions + * @property {number} normal Count of normal reactions + */ + + /** + * The reaction count details object contains information about super and normal reaction counts. + * @type {ReactionCountDetailsData} + */ + this.countDetails = { + burst: data.count_details.burst, + normal: data.count_details.normal, + }; + } } /** @@ -121,18 +155,31 @@ class MessageReaction { return this._emoji.id ?? this._emoji.name; } - _add(user) { + _add(user, burst) { if (this.partial) return; this.users.cache.set(user.id, user); - if (!this.me || user.id !== this.message.client.user.id || this.count === 0) this.count++; - this.me ||= user.id === this.message.client.user.id; + if (!this.me || user.id !== this.message.client.user.id || this.count === 0) { + this.count++; + if (burst) this.countDetails.burst++; + else this.countDetails.normal++; + } + if (user.id === this.message.client.user.id) { + if (burst) this.meBurst = true; + else this.me = true; + } } - - _remove(user) { + _remove(user, burst) { if (this.partial) return; this.users.cache.delete(user.id); - if (!this.me || user.id !== this.message.client.user.id) this.count--; - if (user.id === this.message.client.user.id) this.me = false; + if (!this.me || user.id !== this.message.client.user.id) { + this.count--; + if (burst) this.countDetails.burst--; + else this.countDetails.normal--; + } + if (user.id === this.message.client.user.id) { + if (burst) this.meBurst = false; + else this.me = false; + } if (this.count <= 0 && this.users.cache.size === 0) { this.message.reactions.cache.delete(this.emoji.id ?? this.emoji.name); } diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index a7b00f808e01..53429f66e45b 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -181,6 +181,7 @@ import { APISelectMenuDefaultValue, SelectMenuDefaultValueType, InviteType, + ReactionType, } from 'discord-api-types/v10'; import { ChildProcess } from 'node:child_process'; import { EventEmitter } from 'node:events'; @@ -2414,10 +2415,13 @@ export class MessageReaction { private constructor(client: Client, data: RawMessageReactionData, message: Message); private _emoji: GuildEmoji | ReactionEmoji; + public burstColors: string[] | null; public readonly client: Client; public count: number; + public countDetails: ReactionCountDetailsData; public get emoji(): GuildEmoji | ReactionEmoji; public me: boolean; + public meBurst: boolean; public message: Message | PartialMessage; public get partial(): false; public users: ReactionUserManager; @@ -2428,6 +2432,10 @@ export class MessageReaction { public valueOf(): Snowflake | string; } +export interface MessageReactionEventDetails { + burst: boolean; +} + export interface ModalComponentData { customId: string; title: string; @@ -5294,8 +5302,16 @@ export interface ClientEvents { messages: ReadonlyCollection, channel: GuildTextBasedChannel, ]; - messageReactionAdd: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser]; - messageReactionRemove: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser]; + messageReactionAdd: [ + reaction: MessageReaction | PartialMessageReaction, + user: User | PartialUser, + details: MessageReactionEventDetails, + ]; + messageReactionRemove: [ + reaction: MessageReaction | PartialMessageReaction, + user: User | PartialUser, + details: MessageReactionEventDetails, + ]; messageUpdate: [oldMessage: Message | PartialMessage, newMessage: Message | PartialMessage]; presenceUpdate: [oldPresence: Presence | null, newPresence: Presence]; ready: [client: Client]; @@ -5740,6 +5756,7 @@ export interface FetchMessagesOptions { } export interface FetchReactionUsersOptions { + type?: ReactionType; limit?: number; after?: Snowflake; } @@ -6475,6 +6492,11 @@ export interface MessageSelectOption { value: string; } +export interface ReactionCountDetailsData { + burst: number; + normal: number; +} + export interface SelectMenuComponentOptionData { default?: boolean; description?: string; From fc0b6f7f8ebd94a4a05fac0c76e49b23752a8e65 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Mon, 2 Sep 2024 01:44:51 +0500 Subject: [PATCH 02/42] feat: user-installable apps (#10227) * feat: inital user-installable apps support * docs: add deprecation warnings * feat: add equality checks * fix: possibly `null` cases * docs: tweaks * docs: add deprecations * fix(ApplicationCommandManager): amend transform command * feat: properly support `integration_types_config` * docs: add . * docs: minor changes * featBaseApplicationCommandData): update type * style: prettier * chore: fix issues * fix: correct casing Co-authored-by: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> * refactor: remove console log * fix: use case that satisfies `/core` and the API * fix: `oauth2InstallParams` property is not nullable * fix: do not convert keys into strings * feat: update transforer to return the full map * feat: update transformers * feat: add `PartialGroupDMMessageManager ` Hope this is not a breaking change * docs: fix type * feat: add approximate count of users property * fix: messageCreate doesn't emit in PartialGroupDMChannel * fix: add GroupDM to TextBasedChannelTypes * feat: add NonPartialGroupDMChannel helper * fix: expect PartialGroupDMChannel * feat: narrow generic type * test: exclude PartialGroupDMChannel * feat: use structure's channel type * docs: narrow type * feat: remove transformer * refactor: remove unnecessary parse * feat: add APIAutoModerationAction transformer * fix: use the right transformer during recursive parsing of interaction metadata * docs: add external types * docs: add `Message#interactionMetadata` property docs * docs: make nullable * docs: add d-docs link * docs: use optional * fix: make `oauth2InstallParams` nullable * types: update `IntegrationTypesConfiguration` Co-authored-by: Almeida * docs: update `IntegrationTypesConfigurationParameters` Co-authored-by: Almeida * types: update `IntegrationTypesConfigurationParameters` * refactor: improve readability * docs: mark integrationTypesConfig nullable * refactor: requested changes --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> Co-authored-by: Vlad Frangu Co-authored-by: Almeida --- .../ContextMenuCommandBuilder.ts | 3 + .../slashCommands/SlashCommandBuilder.ts | 2 + .../mixins/SharedSlashCommand.ts | 5 ++ .../src/managers/ApplicationCommandManager.js | 2 + .../managers/PartialGroupDMMessageManager.js | 17 ++++ .../src/structures/ApplicationCommand.js | 27 +++++- .../src/structures/BaseInteraction.js | 4 +- .../src/structures/ClientApplication.js | 64 ++++++++++++++- .../src/structures/CommandInteraction.js | 15 ++++ packages/discord.js/src/structures/Message.js | 29 +++++++ .../src/structures/PartialGroupDMChannel.js | 7 ++ packages/discord.js/src/util/APITypes.js | 20 +++++ packages/discord.js/src/util/Transformers.js | 23 +++++- packages/discord.js/typings/index.d.ts | 82 ++++++++++++++----- packages/discord.js/typings/index.test-d.ts | 5 +- 15 files changed, 278 insertions(+), 27 deletions(-) create mode 100644 packages/discord.js/src/managers/PartialGroupDMMessageManager.js diff --git a/packages/builders/src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts b/packages/builders/src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts index 1c11391c8797..db0e9712f4f1 100644 --- a/packages/builders/src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts +++ b/packages/builders/src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts @@ -67,6 +67,8 @@ export class ContextMenuCommandBuilder { * * @remarks * By default, commands are visible. This property is only for global commands. + * @deprecated + * Use {@link ContextMenuCommandBuilder.contexts} instead. */ public readonly dm_permission: boolean | undefined = undefined; @@ -167,6 +169,7 @@ export class ContextMenuCommandBuilder { * By default, commands are visible. This method is only for global commands. * @param enabled - Whether the command should be enabled in direct messages * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions} + * @deprecated Use {@link ContextMenuCommandBuilder.setContexts} instead. */ public setDMPermission(enabled: boolean | null | undefined) { // Assert the value matches the conditions diff --git a/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts b/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts index 9f94c88ab566..ef6ae652eb8f 100644 --- a/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts +++ b/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts @@ -63,6 +63,8 @@ export class SlashCommandBuilder { * * @remarks * By default, commands are visible. This property is only for global commands. + * @deprecated + * Use {@link SlashCommandBuilder.contexts} instead. */ public readonly dm_permission: boolean | undefined = undefined; diff --git a/packages/builders/src/interactions/slashCommands/mixins/SharedSlashCommand.ts b/packages/builders/src/interactions/slashCommands/mixins/SharedSlashCommand.ts index 3908925bdea8..32b48edd459d 100644 --- a/packages/builders/src/interactions/slashCommands/mixins/SharedSlashCommand.ts +++ b/packages/builders/src/interactions/slashCommands/mixins/SharedSlashCommand.ts @@ -43,6 +43,9 @@ export class SharedSlashCommand { public readonly default_member_permissions: Permissions | null | undefined = undefined; + /** + * @deprecated Use {@link SharedSlashCommand.contexts} instead. + */ public readonly dm_permission: boolean | undefined = undefined; public readonly integration_types?: ApplicationIntegrationType[]; @@ -113,6 +116,8 @@ export class SharedSlashCommand { * By default, commands are visible. This method is only for global commands. * @param enabled - Whether the command should be enabled in direct messages * @see {@link https://discord.com/developers/docs/interactions/application-commands#permissions} + * @deprecated + * Use {@link SharedSlashCommand.setContexts} instead. */ public setDMPermission(enabled: boolean | null | undefined) { // Assert the value matches the conditions diff --git a/packages/discord.js/src/managers/ApplicationCommandManager.js b/packages/discord.js/src/managers/ApplicationCommandManager.js index 884ad9258cde..e38c2f7c8d6c 100644 --- a/packages/discord.js/src/managers/ApplicationCommandManager.js +++ b/packages/discord.js/src/managers/ApplicationCommandManager.js @@ -259,6 +259,8 @@ class ApplicationCommandManager extends CachedManager { options: command.options?.map(option => ApplicationCommand.transformOption(option)), default_member_permissions, dm_permission: command.dmPermission ?? command.dm_permission, + integration_types: command.integrationTypes ?? command.integration_types, + contexts: command.contexts, }; } } diff --git a/packages/discord.js/src/managers/PartialGroupDMMessageManager.js b/packages/discord.js/src/managers/PartialGroupDMMessageManager.js new file mode 100644 index 000000000000..b30abe733f3b --- /dev/null +++ b/packages/discord.js/src/managers/PartialGroupDMMessageManager.js @@ -0,0 +1,17 @@ +'use strict'; + +const MessageManager = require('./MessageManager'); + +/** + * Manages API methods for messages in group direct message channels and holds their cache. + * @extends {MessageManager} + */ +class PartialGroupDMMessageManager extends MessageManager { + /** + * The channel that the messages belong to + * @name PartialGroupDMMessageManager#channel + * @type {PartialGroupDMChannel} + */ +} + +module.exports = PartialGroupDMMessageManager; diff --git a/packages/discord.js/src/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js index fe45763b438d..881822b54a70 100644 --- a/packages/discord.js/src/structures/ApplicationCommand.js +++ b/packages/discord.js/src/structures/ApplicationCommand.js @@ -145,12 +145,35 @@ class ApplicationCommand extends Base { * Whether the command can be used in DMs * This property is always `null` on guild commands * @type {?boolean} + * @deprecated Use {@link ApplicationCommand#contexts} instead. */ this.dmPermission = data.dm_permission; } else { this.dmPermission ??= null; } + if ('integration_types' in data) { + /** + * Installation context(s) where the command is available + * Only for globally-scoped commands + * @type {?ApplicationIntegrationType[]} + */ + this.integrationTypes = data.integration_types; + } else { + this.integrationTypes ??= null; + } + + if ('contexts' in data) { + /** + * Interaction context(s) where the command can be used + * Only for globally-scoped commands + * @type {?InteractionContextType[]} + */ + this.contexts = data.contexts; + } else { + this.contexts ??= null; + } + if ('version' in data) { /** * Autoincrementing version identifier updated during substantial record changes @@ -394,7 +417,9 @@ class ApplicationCommand extends Base { !isEqual( command.descriptionLocalizations ?? command.description_localizations ?? {}, this.descriptionLocalizations ?? {}, - ) + ) || + !isEqual(command.integrationTypes ?? command.integration_types ?? [], this.integrationTypes ?? {}) || + !isEqual(command.contexts ?? [], this.contexts ?? []) ) { return false; } diff --git a/packages/discord.js/src/structures/BaseInteraction.js b/packages/discord.js/src/structures/BaseInteraction.js index d9a1de301dbb..db778080b460 100644 --- a/packages/discord.js/src/structures/BaseInteraction.js +++ b/packages/discord.js/src/structures/BaseInteraction.js @@ -75,9 +75,9 @@ class BaseInteraction extends Base { /** * Set of permissions the application or bot has within the channel the interaction was sent from - * @type {?Readonly} + * @type {Readonly} */ - this.appPermissions = data.app_permissions ? new PermissionsBitField(data.app_permissions).freeze() : null; + this.appPermissions = new PermissionsBitField(data.app_permissions).freeze(); /** * The permissions of the member, if one exists, in the channel this interaction was executed in diff --git a/packages/discord.js/src/structures/ClientApplication.js b/packages/discord.js/src/structures/ClientApplication.js index 3626561dc857..3149a579381a 100644 --- a/packages/discord.js/src/structures/ClientApplication.js +++ b/packages/discord.js/src/structures/ClientApplication.js @@ -15,8 +15,8 @@ const PermissionsBitField = require('../util/PermissionsBitField'); /** * @typedef {Object} ClientApplicationInstallParams - * @property {OAuth2Scopes[]} scopes The scopes to add the application to the server with - * @property {Readonly} permissions The permissions this bot will request upon joining + * @property {OAuth2Scopes[]} scopes Scopes that will be set upon adding this application + * @property {Readonly} permissions Permissions that will be requested for the integrated role */ /** @@ -68,6 +68,56 @@ class ClientApplication extends Application { this.installParams ??= null; } + /** + * OAuth2 installation parameters. + * @typedef {Object} IntegrationTypesConfigurationParameters + * @property {OAuth2Scopes[]} scopes Scopes that will be set upon adding this application + * @property {Readonly} permissions Permissions that will be requested for the integrated role + */ + + /** + * The application's supported installation context data. + * @typedef {Object} IntegrationTypesConfigurationContext + * @property {?IntegrationTypesConfigurationParameters} oauth2InstallParams + * Scopes and permissions regarding the installation context + */ + + /** + * The application's supported installation context data. + * @typedef {Object} IntegrationTypesConfiguration + * @property {IntegrationTypesConfigurationContext} [0] Scopes and permissions + * regarding the guild-installation context + * @property {IntegrationTypesConfigurationContext} [1] Scopes and permissions + * regarding the user-installation context + */ + + if ('integration_types_config' in data) { + /** + * Default scopes and permissions for each supported installation context. + * The keys are stringified variants of {@link ApplicationIntegrationType}. + * @type {?IntegrationTypesConfiguration} + */ + this.integrationTypesConfig = Object.fromEntries( + Object.entries(data.integration_types_config).map(([key, config]) => { + let oauth2InstallParams = null; + if (config.oauth2_install_params) { + oauth2InstallParams = { + scopes: config.oauth2_install_params.scopes, + permissions: new PermissionsBitField(config.oauth2_install_params.permissions).freeze(), + }; + } + + const context = { + oauth2InstallParams, + }; + + return [key, context]; + }), + ); + } else { + this.integrationTypesConfig ??= null; + } + if ('custom_install_url' in data) { /** * This application's custom installation URL @@ -96,6 +146,16 @@ class ClientApplication extends Application { this.approximateGuildCount ??= null; } + if ('approximate_user_install_count' in data) { + /** + * An approximate amount of users that have installed this application. + * @type {?number} + */ + this.approximateUserInstallCount = data.approximate_user_install_count; + } else { + this.approximateUserInstallCount ??= null; + } + if ('guild_id' in data) { /** * The id of the guild associated with this application. diff --git a/packages/discord.js/src/structures/CommandInteraction.js b/packages/discord.js/src/structures/CommandInteraction.js index 0d435deeb446..2dec1230021a 100644 --- a/packages/discord.js/src/structures/CommandInteraction.js +++ b/packages/discord.js/src/structures/CommandInteraction.js @@ -45,6 +45,21 @@ class CommandInteraction extends BaseInteraction { */ this.commandGuildId = data.data.guild_id ?? null; + /* eslint-disable max-len */ + /** + * Mapping of installation contexts that the interaction was authorized for the related user or guild ids + * @type {APIAuthorizingIntegrationOwnersMap} + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object} + */ + this.authorizingIntegrationOwners = data.authorizing_integration_owners; + /* eslint-enable max-len */ + + /** + * Context where the interaction was triggered from + * @type {?InteractionContextType} + */ + this.context = data.context ?? null; + /** * Whether the reply to this interaction has been deferred * @type {boolean} diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 54c279591716..0fe2f762e3ac 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -26,6 +26,7 @@ const { createComponent } = require('../util/Components'); const { NonSystemMessageTypes, MaxBulkDeletableMessageAge, UndeletableMessageTypes } = require('../util/Constants'); const MessageFlagsBitField = require('../util/MessageFlagsBitField'); const PermissionsBitField = require('../util/PermissionsBitField'); +const { _transformAPIMessageInteractionMetadata } = require('../util/Transformers.js'); const { cleanContent, resolvePartialEmoji, transformResolved } = require('../util/Util'); /** @@ -383,6 +384,33 @@ class Message extends Base { this.channel?.messages._add({ guild_id: data.message_reference?.guild_id, ...data.referenced_message }); } + if (data.interaction_metadata) { + /** + * Partial data of the interaction that a message is a result of + * @typedef {Object} MessageInteractionMetadata + * @property {Snowflake} id The interaction's id + * @property {InteractionType} type The type of the interaction + * @property {User} user The user that invoked the interaction + * @property {APIAuthorizingIntegrationOwnersMap} authorizingIntegrationOwners + * Ids for installation context(s) related to an interaction + * @property {?Snowflake} originalResponseMessageId + * Id of the original response message. Present only on follow-up messages + * @property {?Snowflake} interactedMessageId + * Id of the message that contained interactive component. + * Present only on messages created from component interactions + * @property {?MessageInteractionMetadata} triggeringInteractionMetadata + * Metadata for the interaction that was used to open the modal. Present only on modal submit interactions + */ + + /** + * Partial data of the interaction that this message is a result of + * @type {?MessageInteractionMetadata} + */ + this.interactionMetadata = _transformAPIMessageInteractionMetadata(this.client, data.interaction_metadata); + } else { + this.interactionMetadata ??= null; + } + /** * Partial data of the interaction that a message is a reply to * @typedef {Object} MessageInteraction @@ -391,6 +419,7 @@ class Message extends Base { * @property {string} commandName The name of the interaction's application command, * as well as the subcommand and subcommand group, where applicable * @property {User} user The user that invoked the interaction + * @deprecated Use {@link Message#interactionMetadata} instead. */ if (data.interaction) { diff --git a/packages/discord.js/src/structures/PartialGroupDMChannel.js b/packages/discord.js/src/structures/PartialGroupDMChannel.js index ecbb878ce46b..704c8655753c 100644 --- a/packages/discord.js/src/structures/PartialGroupDMChannel.js +++ b/packages/discord.js/src/structures/PartialGroupDMChannel.js @@ -2,6 +2,7 @@ const { BaseChannel } = require('./BaseChannel'); const { DiscordjsError, ErrorCodes } = require('../errors'); +const PartialGroupDMMessageManager = require('../managers/PartialGroupDMMessageManager'); /** * Represents a Partial Group DM Channel on Discord. @@ -37,6 +38,12 @@ class PartialGroupDMChannel extends BaseChannel { * @type {PartialRecipient[]} */ this.recipients = data.recipients; + + /** + * A manager of the messages belonging to this channel + * @type {PartialGroupDMMessageManager} + */ + this.messages = new PartialGroupDMMessageManager(this); } /** diff --git a/packages/discord.js/src/util/APITypes.js b/packages/discord.js/src/util/APITypes.js index 7f2b5922f284..89e3827eeb95 100644 --- a/packages/discord.js/src/util/APITypes.js +++ b/packages/discord.js/src/util/APITypes.js @@ -30,6 +30,16 @@ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIApplicationCommandOption} */ +/** + * @external ApplicationIntegrationType + * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationIntegrationType} + */ + +/** + * @external APIAuthorizingIntegrationOwnersMap + * @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIAuthorizingIntegrationOwnersMap} + */ + /** * @external APIAutoModerationAction * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIAutoModerationAction} @@ -140,6 +150,11 @@ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessageComponentEmoji} */ +/** + * @external APIMessageInteractionMetadata + * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessageInteractionMetadata} + */ + /** * @external APIModalInteractionResponse * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIModalInteractionResponse} @@ -400,6 +415,11 @@ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/IntegrationExpireBehavior} */ +/** + * @external InteractionContextType + * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InteractionContextType} + */ + /** * @external InteractionType * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InteractionType} diff --git a/packages/discord.js/src/util/Transformers.js b/packages/discord.js/src/util/Transformers.js index f4d7af0ec6ab..89d6c5e092c8 100644 --- a/packages/discord.js/src/util/Transformers.js +++ b/packages/discord.js/src/util/Transformers.js @@ -33,4 +33,25 @@ function _transformAPIAutoModerationAction(autoModerationAction) { }; } -module.exports = { toSnakeCase, _transformAPIAutoModerationAction }; +/** + * Transforms an API message interaction metadata object to a camel-cased variant. + * @param {Client} client The client + * @param {APIMessageInteractionMetadata} messageInteractionMetadata The metadata to transform + * @returns {MessageInteractionMetadata} + * @ignore + */ +function _transformAPIMessageInteractionMetadata(client, messageInteractionMetadata) { + return { + id: messageInteractionMetadata.id, + type: messageInteractionMetadata.type, + user: client.users._add(messageInteractionMetadata.user), + authorizingIntegrationOwners: messageInteractionMetadata.authorizing_integration_owners, + originalResponseMessageId: messageInteractionMetadata.original_response_message_id ?? null, + interactedMessageId: messageInteractionMetadata.interacted_message_id ?? null, + triggeringInteractionMetadata: messageInteractionMetadata.triggering_interaction_metadata + ? _transformAPIMessageInteractionMetadata(messageInteractionMetadata.triggering_interaction_metadata) + : null, + }; +} + +module.exports = { toSnakeCase, _transformAPIAutoModerationAction, _transformAPIMessageInteractionMetadata }; diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 53429f66e45b..1dc3d97ea94a 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -175,6 +175,8 @@ import { SKUType, APIEntitlement, EntitlementType, + ApplicationIntegrationType, + InteractionContextType, APIPoll, PollLayoutType, APIPollAnswer, @@ -182,6 +184,7 @@ import { SelectMenuDefaultValueType, InviteType, ReactionType, + APIAuthorizingIntegrationOwnersMap, } from 'discord-api-types/v10'; import { ChildProcess } from 'node:child_process'; import { EventEmitter } from 'node:events'; @@ -429,17 +432,20 @@ export abstract class Application extends Base { export class ApplicationCommand extends Base { private constructor(client: Client, data: RawApplicationCommandData, guild?: Guild, guildId?: Snowflake); public applicationId: Snowflake; + public contexts: InteractionContextType[] | null; public get createdAt(): Date; public get createdTimestamp(): number; public defaultMemberPermissions: Readonly | null; public description: string; public descriptionLocalizations: LocalizationMap | null; public descriptionLocalized: string | null; + /** @deprecated Use {@link ApplicationCommand.contexts} instead */ public dmPermission: boolean | null; public guild: Guild | null; public guildId: Snowflake | null; public get manager(): ApplicationCommandManager; public id: Snowflake; + public integrationTypes: ApplicationIntegrationType[] | null; public name: string; public nameLocalizations: LocalizationMap | null; public nameLocalized: string | null; @@ -541,6 +547,7 @@ export type GuildCacheMessage = CacheTypeReducer< export type BooleanCache = Cached extends 'cached' ? true : false; export abstract class CommandInteraction extends BaseInteraction { + public authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap; public type: InteractionType.ApplicationCommand; public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null; public options: Omit< @@ -565,6 +572,7 @@ export abstract class CommandInteraction e public commandName: string; public commandType: ApplicationCommandType; public commandGuildId: Snowflake | null; + public context: InteractionContextType | null; public deferred: boolean; public ephemeral: boolean | null; public replied: boolean; @@ -1073,8 +1081,10 @@ export class ClientApplication extends Application { public cover: string | null; public flags: Readonly; public approximateGuildCount: number | null; + public approximateUserInstallCount: number | null; public tags: string[]; public installParams: ClientApplicationInstallParams | null; + public integrationTypesConfig: IntegrationTypesConfiguration | null; public customInstallURL: string | null; public owner: User | Team | null; public get partial(): boolean; @@ -1932,7 +1942,7 @@ export class BaseInteraction extends Base public type: InteractionType; public user: User; public version: number; - public appPermissions: CacheTypeReducer>; + public appPermissions: Readonly; public memberPermissions: CacheTypeReducer>; public locale: Locale; public guildLocale: CacheTypeReducer; @@ -2150,7 +2160,9 @@ export class Message extends Base { public get guild(): If; public get hasThread(): boolean; public id: Snowflake; + /** @deprecated Use {@link Message.interactionMetadata} instead. */ public interaction: MessageInteraction | null; + public interactionMetadata: MessageInteractionMetadata | null; public get member(): GuildMember | null; public mentions: MessageMentions; public nonce: string | number | null; @@ -2180,23 +2192,27 @@ export class Message extends Base { public createMessageComponentCollector( options?: MessageCollectorOptionsParams, ): InteractionCollector[ComponentType]>; - public delete(): Promise>; - public edit(content: string | MessageEditOptions | MessagePayload): Promise>; + public delete(): Promise>>; + public edit( + content: string | MessageEditOptions | MessagePayload, + ): Promise>>; public equals(message: Message, rawData: unknown): boolean; - public fetchReference(): Promise>; + public fetchReference(): Promise>>; public fetchWebhook(): Promise; - public crosspost(): Promise>; - public fetch(force?: boolean): Promise>; - public pin(reason?: string): Promise>; + public crosspost(): Promise>>; + public fetch(force?: boolean): Promise>>; + public pin(reason?: string): Promise>>; public react(emoji: EmojiIdentifierResolvable): Promise; - public removeAttachments(): Promise>; - public reply(options: string | MessagePayload | MessageReplyOptions): Promise>; + public removeAttachments(): Promise>>; + public reply( + options: string | MessagePayload | MessageReplyOptions, + ): Promise>>; public resolveComponent(customId: string): MessageActionRowComponent | null; public startThread(options: StartThreadOptions): Promise>; - public suppressEmbeds(suppress?: boolean): Promise>; + public suppressEmbeds(suppress?: boolean): Promise>>; public toJSON(): unknown; public toString(): string; - public unpin(reason?: string): Promise>; + public unpin(reason?: string): Promise>>; public inGuild(): this is Message; } @@ -2540,6 +2556,7 @@ export class PartialGroupDMChannel extends BaseChannel { public name: string | null; public icon: string | null; public recipients: PartialRecipient[]; + public messages: PartialGroupDMMessageManager; public iconURL(options?: ImageURLOptions): string | null; public toString(): ChannelMention; } @@ -4501,6 +4518,10 @@ export class DMMessageManager extends MessageManager { public channel: DMChannel; } +export class PartialGroupDMMessageManager extends MessageManager { + public channel: PartialGroupDMChannel; +} + export class GuildMessageManager extends MessageManager { public channel: GuildTextBasedChannel; public crosspost(message: MessageResolvable): Promise>; @@ -4755,6 +4776,8 @@ export interface BaseApplicationCommandData { dmPermission?: boolean; defaultMemberPermissions?: PermissionResolvable | null; nsfw?: boolean; + contexts?: readonly InteractionContextType[]; + integrationTypes?: readonly ApplicationIntegrationType[]; } export interface AttachmentData { @@ -5247,6 +5270,10 @@ export interface GuildMembersChunk { nonce: string | undefined; } +type NonPartialGroupDMChannel = Structure & { + channel: Exclude; +}; + export interface ClientEvents { applicationCommandPermissionsUpdate: [data: ApplicationCommandPermissionsUpdateData]; autoModerationActionExecution: [autoModerationActionExecution: AutoModerationActionExecution]; @@ -5289,17 +5316,17 @@ export interface ClientEvents { guildUpdate: [oldGuild: Guild, newGuild: Guild]; inviteCreate: [invite: Invite]; inviteDelete: [invite: Invite]; - messageCreate: [message: Message]; - messageDelete: [message: Message | PartialMessage]; + messageCreate: [message: NonPartialGroupDMChannel]; + messageDelete: [message: NonPartialGroupDMChannel]; messagePollVoteAdd: [pollAnswer: PollAnswer, userId: Snowflake]; messagePollVoteRemove: [pollAnswer: PollAnswer, userId: Snowflake]; messageReactionRemoveAll: [ - message: Message | PartialMessage, + message: NonPartialGroupDMChannel, reactions: ReadonlyCollection, ]; messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction]; messageDeleteBulk: [ - messages: ReadonlyCollection, + messages: ReadonlyCollection>, channel: GuildTextBasedChannel, ]; messageReactionAdd: [ @@ -6221,6 +6248,16 @@ export interface IntegrationAccount { export type IntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; +export type IntegrationTypesConfigurationParameters = ClientApplicationInstallParams; + +export interface IntegrationTypesConfigurationContext { + oauth2InstallParams: IntegrationTypesConfigurationParameters | null; +} + +export type IntegrationTypesConfiguration = Partial< + Record +>; + export type CollectedInteraction = | StringSelectMenuInteraction | UserSelectMenuInteraction @@ -6369,6 +6406,16 @@ export interface MessageComponentCollectorOptions extends Omit, 'channel' | 'guild' | 'interactionType'> {} +export interface MessageInteractionMetadata { + id: Snowflake; + type: InteractionType; + user: User; + authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap; + originalResponseMessageId: Snowflake | null; + interactedMessageId: Snowflake | null; + triggeringInteractionMetadata: MessageInteractionMetadata | null; +} + export interface MessageInteraction { id: Snowflake; type: InteractionType; @@ -6829,10 +6876,7 @@ export type Channel = | ForumChannel | MediaChannel; -export type TextBasedChannel = Exclude< - Extract, - PartialGroupDMChannel | ForumChannel | MediaChannel ->; +export type TextBasedChannel = Exclude, ForumChannel | MediaChannel>; export type TextBasedChannels = TextBasedChannel; diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 78093fc55654..02011850550a 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -452,7 +452,7 @@ client.on('messageCreate', async message => { expectType>(message.mentions.members); } - expectType(message.channel); + expectType>(message.channel); expectNotType(message.channel); // @ts-expect-error @@ -1624,7 +1624,7 @@ declare const guildChannelManager: GuildChannelManager; expectType>>(messages.fetchPinned()); expectType(message.guild); expectType(message.guildId); - expectType(message.channel.messages.channel); + expectType(message.channel.messages.channel); expectType(message.mentions); expectType(message.mentions.guild); expectType | null>(message.mentions.members); @@ -2209,6 +2209,7 @@ expectType(TextBasedChannel); expectType< | ChannelType.GuildText | ChannelType.DM + | ChannelType.GroupDM | ChannelType.GuildAnnouncement | ChannelType.GuildVoice | ChannelType.GuildStageVoice From 13dc779029acbea295e208cc0c058f0e6ec0e9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=86MB=C3=98?= <69138346+TAEMBO@users.noreply.github.com> Date: Mon, 2 Sep 2024 00:46:05 -0700 Subject: [PATCH 03/42] fix: message reaction crash (#10469) --- packages/discord.js/src/structures/MessageReaction.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/discord.js/src/structures/MessageReaction.js b/packages/discord.js/src/structures/MessageReaction.js index b6230bacb2ec..45103b553c01 100644 --- a/packages/discord.js/src/structures/MessageReaction.js +++ b/packages/discord.js/src/structures/MessageReaction.js @@ -83,6 +83,8 @@ class MessageReaction { burst: data.count_details.burst, normal: data.count_details.normal, }; + } else { + this.countDetails ??= { burst: 0, normal: 0 }; } } From 3979f0b6e6fbe929545065314f2dd197cf3ec404 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 12:26:08 +0300 Subject: [PATCH 04/42] chore: add in more data to changelog entries (#10470) * chore: add in more data to changelog entries * chore: missed template --- packages/brokers/cliff.toml | 9 ++++++++- packages/builders/cliff.toml | 9 ++++++++- packages/collection/cliff.toml | 9 ++++++++- packages/core/cliff.toml | 9 ++++++++- packages/create-discord-bot/cliff.toml | 9 ++++++++- packages/discord.js/cliff.toml | 9 ++++++++- packages/formatters/cliff.toml | 9 ++++++++- packages/next/cliff.toml | 9 ++++++++- packages/proxy/cliff.toml | 9 ++++++++- packages/rest/cliff.toml | 9 ++++++++- .../turbo/generators/templates/default/cliff.toml | 9 ++++++++- packages/util/cliff.toml | 9 ++++++++- packages/voice/cliff.toml | 9 ++++++++- packages/ws/cliff.toml | 9 ++++++++- 14 files changed, 112 insertions(+), 14 deletions(-) diff --git a/packages/brokers/cliff.toml b/packages/brokers/cliff.toml index ba2acca4bcd1..35a2901131c2 100644 --- a/packages/brokers/cliff.toml +++ b/packages/brokers/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/builders/cliff.toml b/packages/builders/cliff.toml index 10e32d1e6419..834d7df3f988 100644 --- a/packages/builders/cliff.toml +++ b/packages/builders/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/collection/cliff.toml b/packages/collection/cliff.toml index 6a454d95555a..307c58882011 100644 --- a/packages/collection/cliff.toml +++ b/packages/collection/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/core/cliff.toml b/packages/core/cliff.toml index fb128432958d..e01e42509dd2 100644 --- a/packages/core/cliff.toml +++ b/packages/core/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/create-discord-bot/cliff.toml b/packages/create-discord-bot/cliff.toml index 166fb953e7d0..245edd6c62d6 100644 --- a/packages/create-discord-bot/cliff.toml +++ b/packages/create-discord-bot/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/discord.js/cliff.toml b/packages/discord.js/cliff.toml index 6e25c0b7d9ed..e2a9e82ee5c0 100644 --- a/packages/discord.js/cliff.toml +++ b/packages/discord.js/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/formatters/cliff.toml b/packages/formatters/cliff.toml index a1a66b60224d..e7c37c63d28d 100644 --- a/packages/formatters/cliff.toml +++ b/packages/formatters/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/next/cliff.toml b/packages/next/cliff.toml index 8bd5b95951a6..ce63ba045147 100644 --- a/packages/next/cliff.toml +++ b/packages/next/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/proxy/cliff.toml b/packages/proxy/cliff.toml index f3347d86b9c9..dffb706e3e7a 100644 --- a/packages/proxy/cliff.toml +++ b/packages/proxy/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/rest/cliff.toml b/packages/rest/cliff.toml index 13f4176daf2b..31962f61267e 100644 --- a/packages/rest/cliff.toml +++ b/packages/rest/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/scripts/turbo/generators/templates/default/cliff.toml b/packages/scripts/turbo/generators/templates/default/cliff.toml index e2ba49b93033..65a05384048c 100644 --- a/packages/scripts/turbo/generators/templates/default/cliff.toml +++ b/packages/scripts/turbo/generators/templates/default/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/util/cliff.toml b/packages/util/cliff.toml index eef2a410a9b6..f932465f396b 100644 --- a/packages/util/cliff.toml +++ b/packages/util/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/voice/cliff.toml b/packages/voice/cliff.toml index e940fd2ca9d1..cfd0279ee76a 100644 --- a/packages/voice/cliff.toml +++ b/packages/voice/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" diff --git a/packages/ws/cliff.toml b/packages/ws/cliff.toml index 22066f5d0901..95f85d41958e 100644 --- a/packages/ws/cliff.toml +++ b/packages/ws/cliff.toml @@ -28,13 +28,20 @@ body = """ **{{commit.scope}}:** \ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ {% for breakingChange in commit.footers %}\ \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ {% endfor %} -{% endfor %}\n +{% endfor %}\ +{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\ + \n### New Contributors\n + {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\ + * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + {% endfor %}\ +{% endif %}\n """ trim = true footer = "" From cec816f9f5cd37ef425c9f1b48784917126cbe42 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:04:10 +0300 Subject: [PATCH 05/42] chore(brokers): release @discordjs/brokers@1.0.0 --- packages/brokers/CHANGELOG.md | 13 +++++++++++++ packages/brokers/package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/brokers/CHANGELOG.md b/packages/brokers/CHANGELOG.md index ae976f9d012b..f2a0f869fa6c 100644 --- a/packages/brokers/CHANGELOG.md +++ b/packages/brokers/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. +# [@discordjs/brokers@1.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/brokers@0.3.0...@discordjs/brokers@1.0.0) - (2024-09-01) + +## Refactor + +- **brokers:** Re-design API to make groups a constructor option (#10297) ([38a37b5](https://github.com/discordjs/discord.js/commit/38a37b5caf06913131c6dc2dc5cc258aecfe2266)) +- **brokers:** Make option props more correct (#10242) ([393ded4](https://github.com/discordjs/discord.js/commit/393ded4ea14e73b2bb42226f57896130329f88ca)) + - **BREAKING CHANGE:** Classes now take redis client as standalone parameter, various props from the base option interface moved to redis options + +* chore: update comment + +--------- + - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + # [@discordjs/brokers@0.3.0](https://github.com/discordjs/discord.js/compare/@discordjs/brokers@0.2.3...@discordjs/brokers@0.3.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/brokers/package.json b/packages/brokers/package.json index 0d0c8d3a3382..0c34ece3484f 100644 --- a/packages/brokers/package.json +++ b/packages/brokers/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/brokers", - "version": "0.3.0", + "version": "1.0.0", "description": "Powerful set of message brokers", "scripts": { "test": "vitest run", From 74df5c7fa4998643c572533e0d73c129443d0c28 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:04:51 +0300 Subject: [PATCH 06/42] chore(collection): release @discordjs/collection@2.1.1 --- packages/collection/CHANGELOG.md | 14 ++++++++++++++ packages/collection/package.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/collection/CHANGELOG.md b/packages/collection/CHANGELOG.md index 592c088e5d9c..62dee661883c 100644 --- a/packages/collection/CHANGELOG.md +++ b/packages/collection/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. +# [@discordjs/collection@2.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/collection@2.1.0...@discordjs/collection@2.1.1) - (2024-09-01) + +## Bug Fixes + +- **build:** Update to support strictBuiltinIteratorReturn (#10394) ([bf83db9](https://github.com/discordjs/discord.js/commit/bf83db9480e9f31d5dadee38a2d053a543150776)) + +## Testing + +- Complete collection coverage (#10380) ([d8e94d8](https://github.com/discordjs/discord.js/commit/d8e94d8f10367d165d15904f7c7a31165842f9ec)) + +## Typings + +- **collection:** Reduce* method signatures (#10405) ([6b38335](https://github.com/discordjs/discord.js/commit/6b383350a6de6d26b62cf62f619c89ffb0d6b0d1)) + # [@discordjs/collection@2.1.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@2.0.0...@discordjs/collection@2.1.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/collection/package.json b/packages/collection/package.json index 54a6d931758d..eeb2661cf57c 100644 --- a/packages/collection/package.json +++ b/packages/collection/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/collection", - "version": "2.1.0", + "version": "2.1.1", "description": "Utility data structure used in discord.js", "scripts": { "test": "vitest run", From ec7b20f51d9e33c652f5b9280cdff5e631d61b81 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:05:10 +0300 Subject: [PATCH 07/42] chore(create-discord-bot): release create-discord-bot@0.3.1 --- packages/create-discord-bot/CHANGELOG.md | 6 ++++++ packages/create-discord-bot/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/create-discord-bot/CHANGELOG.md b/packages/create-discord-bot/CHANGELOG.md index 1546e23967c3..16795189317e 100644 --- a/packages/create-discord-bot/CHANGELOG.md +++ b/packages/create-discord-bot/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +# [create-discord-bot/0.3.1](https://github.com/discordjs/discord.js/compare/create-discord-bot@0.3.0...create-discord-bot/0.3.1) - (2024-09-01) + +## Bug Fixes + +- Failed build in node and bad lints (#10444) ([00accf7](https://github.com/discordjs/discord.js/commit/00accf74708b4ce8a032907005ae81460b79a988)) + # [create-discord-bot@0.3.0](https://github.com/discordjs/discord.js/compare/create-discord-bot@0.2.3...create-discord-bot@0.3.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/create-discord-bot/package.json b/packages/create-discord-bot/package.json index 283323cd6218..620f36b1d61c 100644 --- a/packages/create-discord-bot/package.json +++ b/packages/create-discord-bot/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "create-discord-bot", - "version": "0.3.0", + "version": "0.3.1", "description": "A simple way to create a startup Discord bot.", "scripts": { "build": "tsc --noEmit && tsup", From 5e08ea68d2579283bc10ebfc024419f5695007ea Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:06:56 +0300 Subject: [PATCH 08/42] chore(formatters): release @discordjs/formatters@0.5.0 --- packages/formatters/CHANGELOG.md | 7 +++++++ packages/formatters/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/formatters/CHANGELOG.md b/packages/formatters/CHANGELOG.md index cf6a34381dbf..5b38ff732cea 100644 --- a/packages/formatters/CHANGELOG.md +++ b/packages/formatters/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +# [@discordjs/formatters@0.5.0](https://github.com/discordjs/discord.js/compare/@discordjs/formatters@0.4.0...@discordjs/formatters@0.5.0) - (2024-09-01) + +## Features + +- Add subtext formatter (#10400) ([fcd35ea](https://github.com/discordjs/discord.js/commit/fcd35ea2e72b3268729466e4cd85b2794bb3394b)) +- Premium buttons (#10353) ([4f59b74](https://github.com/discordjs/discord.js/commit/4f59b740d01b9ff2213949708a36e17da32b89c3)) + # [@discordjs/formatters@0.4.0](https://github.com/discordjs/discord.js/compare/@discordjs/formatters@0.3.3...@discordjs/formatters@0.4.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/formatters/package.json b/packages/formatters/package.json index a6fca5704741..9e1093cf05ce 100644 --- a/packages/formatters/package.json +++ b/packages/formatters/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/formatters", - "version": "0.4.0", + "version": "0.5.0", "description": "A set of functions to format strings for Discord.", "scripts": { "test": "vitest run", From ea597aa886b16105f743dd0e5d765ac4788ad8e9 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:07:21 +0300 Subject: [PATCH 09/42] chore(util): release @discordjs/util@1.1.1 --- packages/util/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/util/package.json b/packages/util/package.json index 05651f0a5c03..26fd6945f6bc 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/util", - "version": "1.1.0", + "version": "1.1.1", "description": "Utilities shared across Discord.js packages", "scripts": { "build": "tsc --noEmit && tsup", From b3f3d54f18dfb38869356700b9e31cd95d8c9071 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:07:42 +0300 Subject: [PATCH 10/42] chore(builders): release @discordjs/builders@1.9.0 --- packages/builders/CHANGELOG.md | 10 ++++++++++ packages/builders/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/builders/CHANGELOG.md b/packages/builders/CHANGELOG.md index 48cbc0d35e7a..75ca856b89ec 100644 --- a/packages/builders/CHANGELOG.md +++ b/packages/builders/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +# [@discordjs/builders@1.9.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.8.2...@discordjs/builders@1.9.0) - (2024-09-01) + +## Features + +- User-installable apps (#10227) ([fc0b6f7](https://github.com/discordjs/discord.js/commit/fc0b6f7f8ebd94a4a05fac0c76e49b23752a8e65)) +- **builders:** Update to @sapphire/shapeshift v4 (#10291) ([2d5531f](https://github.com/discordjs/discord.js/commit/2d5531f35c6b4d70f83e46b99c284030108dcf5c)) +- **SlashCommandBuilder:** Add explicit command type when building (#10395) ([b2970bb](https://github.com/discordjs/discord.js/commit/b2970bb2dddf70d2d918fda825059315f35d23f3)) +- Premium buttons (#10353) ([4f59b74](https://github.com/discordjs/discord.js/commit/4f59b740d01b9ff2213949708a36e17da32b89c3)) +- Add user-installable apps support (#10348) ([9c76bbe](https://github.com/discordjs/discord.js/commit/9c76bbea172d49320f7fdac19ec1a43a49d05116)) + # [@discordjs/builders@1.8.2](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.8.1...@discordjs/builders@1.8.2) - (2024-06-02) ## Bug Fixes diff --git a/packages/builders/package.json b/packages/builders/package.json index 5756d169865d..2d49f7f6481b 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/builders", - "version": "1.8.2", + "version": "1.9.0", "description": "A set of builders that you can use when creating your bot", "scripts": { "test": "vitest run", From 6b34486f3f56ded76c7770346946c9b5586cf127 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:07:56 +0300 Subject: [PATCH 11/42] chore(rest): release @discordjs/rest@2.4.0 --- packages/rest/CHANGELOG.md | 10 ++++++++++ packages/rest/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/rest/CHANGELOG.md b/packages/rest/CHANGELOG.md index c86ae28d7fe4..c2879f094870 100644 --- a/packages/rest/CHANGELOG.md +++ b/packages/rest/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +# [@discordjs/rest@2.4.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@2.3.0...@discordjs/rest@2.4.0) - (2024-09-01) + +## Bug Fixes + +- Correct base path for GIF stickers (#10330) ([599ad3e](https://github.com/discordjs/discord.js/commit/599ad3eab556463bcde60f8941d0354475cde16b)) + +## Features + +- **User:** Add `avatarDecorationData` (#9888) ([3b5c600](https://github.com/discordjs/discord.js/commit/3b5c600b9e3f8d40ed48f02e3c9acec7433f1cc3)) + # [@discordjs/rest@2.3.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@2.2.0...@discordjs/rest@2.3.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/rest/package.json b/packages/rest/package.json index 14e158fdf006..af0626d0be10 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/rest", - "version": "2.3.0", + "version": "2.4.0", "description": "The REST API for discord.js", "scripts": { "test": "vitest run", From 4059432c786a4c3d1a71ceb21a7d02e692fb9a93 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:08:10 +0300 Subject: [PATCH 12/42] chore(proxy): release @discordjs/proxy@2.1.1 --- packages/proxy/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proxy/package.json b/packages/proxy/package.json index b3da34cf6c04..f8ddfe807413 100644 --- a/packages/proxy/package.json +++ b/packages/proxy/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/proxy", - "version": "2.1.0", + "version": "2.1.1", "description": "Tools for running an HTTP proxy for Discord's API", "scripts": { "test": "vitest run", From c887388db641ef276be20ad12c9a55deed2b29d2 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:09:20 +0300 Subject: [PATCH 13/42] chore(ws): release @discordjs/ws@2.0.0 --- packages/ws/CHANGELOG.md | 26 ++++++++++++++++++++++++++ packages/ws/package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/ws/CHANGELOG.md b/packages/ws/CHANGELOG.md index 1ff7c016d702..1b436235ea8e 100644 --- a/packages/ws/CHANGELOG.md +++ b/packages/ws/CHANGELOG.md @@ -2,6 +2,32 @@ All notable changes to this project will be documented in this file. +# [@discordjs/ws@2.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.0...@discordjs/ws@2.0.0) - (2024-09-01) + +## Bug Fixes + +- **WebSocketShard:** Buffer native zlib decompression payload (#10416) ([defb083](https://github.com/discordjs/discord.js/commit/defb083528ef31383778187a04ced8b00d886242)) +- **WebSocketManager:** Heartbeat event had outdated types (#10417) ([5eabec1](https://github.com/discordjs/discord.js/commit/5eabec14d45ef7bdd7f610e84234eb63e726eacd)) +- Retry for EAI_AGAIN I/O error (#10383) ([be04acd](https://github.com/discordjs/discord.js/commit/be04acd534d7d0c3fb7f6bd174e4a6482aae0d73)) +- Consistent debug log spacing (#10349) ([38c699b](https://github.com/discordjs/discord.js/commit/38c699bc8a2ca40f37f70c93e08067e00f12ee81)) + +## Features + +- **WebsocketManager:** Retroactive token setting (#10418) ([de94eaf](https://github.com/discordjs/discord.js/commit/de94eaf351a69fab57ec766bd9e90e8c05e8c3d1)) +- **WebSocketShard:** Explicit time out network error handling (#10375) ([093ac92](https://github.com/discordjs/discord.js/commit/093ac924aef1bf328feadb49876bfbe26052fe1a)) + +## Refactor + +- **WebSocketShard:** Error event handling (#10436) ([a6de270](https://github.com/discordjs/discord.js/commit/a6de2707fc1107262b12491f73b5b6887df91c67)) +- **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) + - **BREAKING CHANGE:** All events now emit shard id as its own param + +* fix: worker event forwarding + +--------- + - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> +- Native zlib support (#10316) ([94cc02a](https://github.com/discordjs/discord.js/commit/94cc02a2580496774d75673abc0caabc765d9ee0)) + # [@discordjs/ws@1.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.0...@discordjs/ws@1.1.1) - (2024-06-02) ## Bug Fixes diff --git a/packages/ws/package.json b/packages/ws/package.json index e079cc112b5b..2c913f43ebbd 100644 --- a/packages/ws/package.json +++ b/packages/ws/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/ws", - "version": "1.1.1", + "version": "2.0.0", "description": "Wrapper around Discord's gateway", "scripts": { "test": "vitest run", From 584bd6f2fc4732a5fc6e8690efc0dd4fe7b88096 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:10:52 +0300 Subject: [PATCH 14/42] chore(core): release @discordjs/core@2.0.0 --- packages/core/CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ packages/core/package.json | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 7737d3fd3e2e..98ecde679285 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -2,6 +2,36 @@ All notable changes to this project will be documented in this file. +# [@discordjs/core@2.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/core@1.2.0...@discordjs/core@2.0.0) - (2024-09-01) + +## Bug Fixes + +- **OAuth2API:** Enable token exchange without token (#10312) ([9b07036](https://github.com/discordjs/discord.js/commit/9b07036d707b123709480987d5741d6ba75b148b)) + +## Documentation + +- **stageInstances:** Correct reference for stage instance creation (#10333) ([7f60a8f](https://github.com/discordjs/discord.js/commit/7f60a8fc5d412718e269774505b2ed4fc30a83cd)) + +## Features + +- Use get sticker pack endpoint (#10445) ([1b1ae2f](https://github.com/discordjs/discord.js/commit/1b1ae2f0cb339170e4c0692eb43fbc966fd64030)) +- **VoiceState:** Add methods for fetching voice state (#10442) ([9907ff9](https://github.com/discordjs/discord.js/commit/9907ff915e7c72e7e980d68bf005763a3aacad1c)) +- Application emojis (#10399) ([5d92525](https://github.com/discordjs/discord.js/commit/5d92525596a0193fe65626119bb040c2eb9e945a)) +- **OAuth2API:** Add `revokeToken` method (#10440) ([69adc6f](https://github.com/discordjs/discord.js/commit/69adc6f4b9eb4fafe4a20b01137a270621f1365f)) +- Premium buttons (#10353) ([4f59b74](https://github.com/discordjs/discord.js/commit/4f59b740d01b9ff2213949708a36e17da32b89c3)) +- Add `reason` to `followAnnouncements` method (#10275) ([b36ec98](https://github.com/discordjs/discord.js/commit/b36ec983828c7001e47debcd435592ea026768d5)) + +## Refactor + +- Use get guild role endpoint (#10443) ([bba0e72](https://github.com/discordjs/discord.js/commit/bba0e72e2283630b9f84b77d53525397036c6b31)) +- **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) + - **BREAKING CHANGE:** All events now emit shard id as its own param + +* fix: worker event forwarding + +--------- + - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + # [@discordjs/core@1.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/core@1.1.1...@discordjs/core@1.2.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/core/package.json b/packages/core/package.json index 3bee4f6dfb89..bc0ad2c8c800 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@discordjs/core", - "version": "1.2.0", + "version": "2.0.0", "description": "A thinly abstracted wrapper around the rest API, and gateway.", "scripts": { "test": "vitest run", From 0411ce268e72fd76620904d8a76803c673167aa7 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 00:15:41 +0300 Subject: [PATCH 15/42] chore(create-discord-bot): fix changelog link --- packages/create-discord-bot/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-discord-bot/CHANGELOG.md b/packages/create-discord-bot/CHANGELOG.md index 16795189317e..5e1001a609f2 100644 --- a/packages/create-discord-bot/CHANGELOG.md +++ b/packages/create-discord-bot/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -# [create-discord-bot/0.3.1](https://github.com/discordjs/discord.js/compare/create-discord-bot@0.3.0...create-discord-bot/0.3.1) - (2024-09-01) +# [create-discord-bot@0.3.1](https://github.com/discordjs/discord.js/compare/create-discord-bot@0.3.0...create-discord-bot@0.3.1) - (2024-09-01) ## Bug Fixes From 2cb2d81b82d9e75fb6d4f1cd89f1d532af671fac Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 01:15:38 +0300 Subject: [PATCH 16/42] chore: cleanup changelogs --- packages/core/CHANGELOG.md | 6 +----- packages/ws/CHANGELOG.md | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 98ecde679285..1142861af73b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -26,11 +26,7 @@ All notable changes to this project will be documented in this file. - Use get guild role endpoint (#10443) ([bba0e72](https://github.com/discordjs/discord.js/commit/bba0e72e2283630b9f84b77d53525397036c6b31)) - **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) - **BREAKING CHANGE:** All events now emit shard id as its own param - -* fix: worker event forwarding - ---------- - - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + - fix: worker event forwarding # [@discordjs/core@1.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/core@1.1.1...@discordjs/core@1.2.0) - (2024-05-04) diff --git a/packages/ws/CHANGELOG.md b/packages/ws/CHANGELOG.md index 1b436235ea8e..9f9e838e5e11 100644 --- a/packages/ws/CHANGELOG.md +++ b/packages/ws/CHANGELOG.md @@ -21,11 +21,7 @@ All notable changes to this project will be documented in this file. - **WebSocketShard:** Error event handling (#10436) ([a6de270](https://github.com/discordjs/discord.js/commit/a6de2707fc1107262b12491f73b5b6887df91c67)) - **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) - **BREAKING CHANGE:** All events now emit shard id as its own param - -* fix: worker event forwarding - ---------- - - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> + - fix: worker event forwarding - Native zlib support (#10316) ([94cc02a](https://github.com/discordjs/discord.js/commit/94cc02a2580496774d75673abc0caabc765d9ee0)) # [@discordjs/ws@1.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.0...@discordjs/ws@1.1.1) - (2024-06-02) From b715b7d6537c0d6ea8136baa0e20c8927b76f023 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 01:17:19 +0300 Subject: [PATCH 17/42] chore: cleanup 2 --- packages/brokers/CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/brokers/CHANGELOG.md b/packages/brokers/CHANGELOG.md index f2a0f869fa6c..365a4a4a2f0e 100644 --- a/packages/brokers/CHANGELOG.md +++ b/packages/brokers/CHANGELOG.md @@ -10,11 +10,6 @@ All notable changes to this project will be documented in this file. - **brokers:** Make option props more correct (#10242) ([393ded4](https://github.com/discordjs/discord.js/commit/393ded4ea14e73b2bb42226f57896130329f88ca)) - **BREAKING CHANGE:** Classes now take redis client as standalone parameter, various props from the base option interface moved to redis options -* chore: update comment - ---------- - - **Co-authored-by:** kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> - # [@discordjs/brokers@0.3.0](https://github.com/discordjs/discord.js/compare/@discordjs/brokers@0.2.3...@discordjs/brokers@0.3.0) - (2024-05-04) ## Bug Fixes From 6a6bc6397323a6ea2f07eea38a2ab2be1bafe8dc Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 01:24:33 +0300 Subject: [PATCH 18/42] chore: requested cleanup --- packages/core/CHANGELOG.md | 1 - packages/ws/CHANGELOG.md | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 1142861af73b..e9c58de6c8f6 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -26,7 +26,6 @@ All notable changes to this project will be documented in this file. - Use get guild role endpoint (#10443) ([bba0e72](https://github.com/discordjs/discord.js/commit/bba0e72e2283630b9f84b77d53525397036c6b31)) - **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) - **BREAKING CHANGE:** All events now emit shard id as its own param - - fix: worker event forwarding # [@discordjs/core@1.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/core@1.1.1...@discordjs/core@1.2.0) - (2024-05-04) diff --git a/packages/ws/CHANGELOG.md b/packages/ws/CHANGELOG.md index 9f9e838e5e11..7bd2563b601a 100644 --- a/packages/ws/CHANGELOG.md +++ b/packages/ws/CHANGELOG.md @@ -21,7 +21,6 @@ All notable changes to this project will be documented in this file. - **WebSocketShard:** Error event handling (#10436) ([a6de270](https://github.com/discordjs/discord.js/commit/a6de2707fc1107262b12491f73b5b6887df91c67)) - **ws:** Event layout (#10376) ([bf6761a](https://github.com/discordjs/discord.js/commit/bf6761a44adec1fe5017f6bf5d8bc0734916961f)) - **BREAKING CHANGE:** All events now emit shard id as its own param - - fix: worker event forwarding - Native zlib support (#10316) ([94cc02a](https://github.com/discordjs/discord.js/commit/94cc02a2580496774d75673abc0caabc765d9ee0)) # [@discordjs/ws@1.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.0...@discordjs/ws@1.1.1) - (2024-06-02) From 23636a9a2fd756c16eaecf9b3e6fc7f2e6536c00 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 01:28:00 +0300 Subject: [PATCH 19/42] chore: add versions mentions for versions with meta changes only --- packages/proxy/CHANGELOG.md | 2 ++ packages/util/CHANGELOG.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/proxy/CHANGELOG.md b/packages/proxy/CHANGELOG.md index 7aa02d54d1f3..3f39bb498f56 100644 --- a/packages/proxy/CHANGELOG.md +++ b/packages/proxy/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +# [@discordjs/proxy@2.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/proxy@2.1.0...@discordjs/proxy@2.1.1) - (2024-09-01) + # [@discordjs/proxy@2.1.0](https://github.com/discordjs/discord.js/compare/@discordjs/proxy@2.0.2...@discordjs/proxy@2.1.0) - (2024-05-04) ## Bug Fixes diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 323cc363cd80..e23014ca5eb5 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +# [@discordjs/util@1.1.1](https://github.com/discordjs/discord.js/compare/@discordjs/util@1.1.0...@discordjs/util@1.1.1) - (2024-09-01) + # [@discordjs/util@1.1.0](https://github.com/discordjs/discord.js/compare/@discordjs/util@1.0.2...@discordjs/util@1.1.0) - (2024-05-04) ## Bug Fixes From 1f2047ff90babb7de25fd045dfdad827ec53d29e Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 01:30:57 +0300 Subject: [PATCH 20/42] chore(create-discord-app): update discord.js version for templates --- .../create-discord-bot/template/Bun/JavaScript/package.json | 2 +- .../create-discord-bot/template/Bun/TypeScript/package.json | 2 +- packages/create-discord-bot/template/Deno/src/commands/index.ts | 2 +- packages/create-discord-bot/template/Deno/src/events/index.ts | 2 +- packages/create-discord-bot/template/Deno/src/events/ready.ts | 2 +- packages/create-discord-bot/template/Deno/src/index.ts | 2 +- packages/create-discord-bot/template/Deno/src/util/deploy.ts | 2 +- .../create-discord-bot/template/Deno/src/util/registerEvents.ts | 2 +- packages/create-discord-bot/template/JavaScript/package.json | 2 +- packages/create-discord-bot/template/TypeScript/package.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/create-discord-bot/template/Bun/JavaScript/package.json b/packages/create-discord-bot/template/Bun/JavaScript/package.json index 75f6b646ea9d..8447a3277b13 100644 --- a/packages/create-discord-bot/template/Bun/JavaScript/package.json +++ b/packages/create-discord-bot/template/Bun/JavaScript/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@discordjs/core": "^1.2.0", - "discord.js": "^14.15.3" + "discord.js": "^14.16.0" }, "devDependencies": { "eslint": "^8.57.0", diff --git a/packages/create-discord-bot/template/Bun/TypeScript/package.json b/packages/create-discord-bot/template/Bun/TypeScript/package.json index 331f9eec8104..5ca5753ca72f 100644 --- a/packages/create-discord-bot/template/Bun/TypeScript/package.json +++ b/packages/create-discord-bot/template/Bun/TypeScript/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@discordjs/core": "^1.2.0", - "discord.js": "^14.15.3" + "discord.js": "^14.16.0" }, "devDependencies": { "@sapphire/ts-config": "^5.0.1", diff --git a/packages/create-discord-bot/template/Deno/src/commands/index.ts b/packages/create-discord-bot/template/Deno/src/commands/index.ts index 3088b9fedbc7..3fddae88a812 100644 --- a/packages/create-discord-bot/template/Deno/src/commands/index.ts +++ b/packages/create-discord-bot/template/Deno/src/commands/index.ts @@ -1,4 +1,4 @@ -import type { RESTPostAPIApplicationCommandsJSONBody, CommandInteraction } from 'npm:discord.js@^14.15.3'; +import type { RESTPostAPIApplicationCommandsJSONBody, CommandInteraction } from 'npm:discord.js@^14.16.0'; import { z } from 'npm:zod@^3.23.8'; import type { StructurePredicate } from '../util/loaders.ts'; diff --git a/packages/create-discord-bot/template/Deno/src/events/index.ts b/packages/create-discord-bot/template/Deno/src/events/index.ts index a02e55773620..2e1b61690354 100644 --- a/packages/create-discord-bot/template/Deno/src/events/index.ts +++ b/packages/create-discord-bot/template/Deno/src/events/index.ts @@ -1,4 +1,4 @@ -import type { ClientEvents } from 'npm:discord.js@^14.15.3'; +import type { ClientEvents } from 'npm:discord.js@^14.16.0'; import { z } from 'npm:zod@^3.23.8'; import type { StructurePredicate } from '../util/loaders.ts'; diff --git a/packages/create-discord-bot/template/Deno/src/events/ready.ts b/packages/create-discord-bot/template/Deno/src/events/ready.ts index a29759f158a8..bd0c412e7aa9 100644 --- a/packages/create-discord-bot/template/Deno/src/events/ready.ts +++ b/packages/create-discord-bot/template/Deno/src/events/ready.ts @@ -1,4 +1,4 @@ -import { Events } from 'npm:discord.js@^14.14.1'; +import { Events } from 'npm:discord.js@^14.16.0'; import type { Event } from './index.ts'; export default { diff --git a/packages/create-discord-bot/template/Deno/src/index.ts b/packages/create-discord-bot/template/Deno/src/index.ts index 99b475e08b23..6552757e99de 100644 --- a/packages/create-discord-bot/template/Deno/src/index.ts +++ b/packages/create-discord-bot/template/Deno/src/index.ts @@ -1,6 +1,6 @@ import 'https://deno.land/std@0.199.0/dotenv/load.ts'; import { URL } from 'node:url'; -import { Client, GatewayIntentBits } from 'npm:discord.js@^14.15.3'; +import { Client, GatewayIntentBits } from 'npm:discord.js@^14.16.0'; import { loadCommands, loadEvents } from './util/loaders.ts'; import { registerEvents } from './util/registerEvents.ts'; diff --git a/packages/create-discord-bot/template/Deno/src/util/deploy.ts b/packages/create-discord-bot/template/Deno/src/util/deploy.ts index 5ab15276c3b6..64289fd97a23 100644 --- a/packages/create-discord-bot/template/Deno/src/util/deploy.ts +++ b/packages/create-discord-bot/template/Deno/src/util/deploy.ts @@ -1,7 +1,7 @@ import 'https://deno.land/std@0.223.0/dotenv/load.ts'; import { URL } from 'node:url'; import { API } from 'npm:@discordjs/core@^1.2.0/http-only'; -import { REST } from 'npm:discord.js@^14.15.3'; +import { REST } from 'npm:discord.js@^14.16.0'; import { loadCommands } from './loaders.ts'; const commands = await loadCommands(new URL('../commands/', import.meta.url)); diff --git a/packages/create-discord-bot/template/Deno/src/util/registerEvents.ts b/packages/create-discord-bot/template/Deno/src/util/registerEvents.ts index 0def42a067d9..5f89519ae022 100644 --- a/packages/create-discord-bot/template/Deno/src/util/registerEvents.ts +++ b/packages/create-discord-bot/template/Deno/src/util/registerEvents.ts @@ -1,4 +1,4 @@ -import { Events, type Client } from 'npm:discord.js@^14.14.1'; +import { Events, type Client } from 'npm:discord.js@^14.16.0'; import type { Command } from '../commands/index.ts'; import type { Event } from '../events/index.ts'; diff --git a/packages/create-discord-bot/template/JavaScript/package.json b/packages/create-discord-bot/template/JavaScript/package.json index 42b4405e359f..07e485592b18 100644 --- a/packages/create-discord-bot/template/JavaScript/package.json +++ b/packages/create-discord-bot/template/JavaScript/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@discordjs/core": "^1.2.0", - "discord.js": "^14.15.3", + "discord.js": "^14.16.0", "dotenv": "^16.4.5" }, "devDependencies": { diff --git a/packages/create-discord-bot/template/TypeScript/package.json b/packages/create-discord-bot/template/TypeScript/package.json index 5cea9ca151d5..12b2c99ace44 100644 --- a/packages/create-discord-bot/template/TypeScript/package.json +++ b/packages/create-discord-bot/template/TypeScript/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@discordjs/core": "^1.2.0", - "discord.js": "^14.15.3", + "discord.js": "^14.16.0", "dotenv": "^16.4.5" }, "devDependencies": { From 641a980b6037897dd9e5a7277418d362057b7cb6 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 11:58:30 +0300 Subject: [PATCH 21/42] chore(discord.js): release discord.js@14.16.0 --- packages/discord.js/CHANGELOG.md | 45 ++++++++++++++++++++++++++++++++ packages/discord.js/package.json | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/CHANGELOG.md b/packages/discord.js/CHANGELOG.md index e9264232a803..807d291c5599 100644 --- a/packages/discord.js/CHANGELOG.md +++ b/packages/discord.js/CHANGELOG.md @@ -2,6 +2,51 @@ All notable changes to this project will be documented in this file. +# [14.16.0](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.1...14.16.0) - (2024-09-02) + +## Bug Fixes + +- Message reaction crash (#10469) ([13dc779](https://github.com/discordjs/discord.js/commit/13dc779029acbea295e208cc0c058f0e6ec0e9aa)) +- **MessagePayload:** Crash when resolving body (#10454) ([dd795da](https://github.com/discordjs/discord.js/commit/dd795da790ac4107bc9d8d55aa7bc119367ee8c6)) +- **Shard:** Add env, execArgv, and argv for worker-based shards (#10429) ([b0f8df0](https://github.com/discordjs/discord.js/commit/b0f8df0f6c7d2a89838132c886294428ddf090d9)) +- **GuildAuditLogsEntry:** Correct mapped `AuditLogChange` objects (#10438) ([45f7e1a](https://github.com/discordjs/discord.js/commit/45f7e1a2e85da760f548765b768bd1b378bdedb9)) +- **GuildMemberManager:** Fix data type check for `add()` method (#10338) ([ab8bf0f](https://github.com/discordjs/discord.js/commit/ab8bf0f4d2a50cd85cf8b2aa1d4e2ea93872807b)) +- Consistent debug log spacing (#10349) ([38c699b](https://github.com/discordjs/discord.js/commit/38c699bc8a2ca40f37f70c93e08067e00f12ee81)) + +## Documentation + +- Correct documentation for BaseInteraction#inCachedGuild (#10456) ([bddf018](https://github.com/discordjs/discord.js/commit/bddf018f266f7050d64f414aa60dd01b1568a1ef)) +- Lowercase "image" URL (#10386) ([785ec8f](https://github.com/discordjs/discord.js/commit/785ec8fd757da1d8cf7963e3cec231a6d5fe4a24)) +- Update rule trigger types (#9708) ([757bed0](https://github.com/discordjs/discord.js/commit/757bed0b1f345a8963bc4eb680bed4462531fb49)) + +## Features + +- User-installable apps (#10227) ([fc0b6f7](https://github.com/discordjs/discord.js/commit/fc0b6f7f8ebd94a4a05fac0c76e49b23752a8e65)) +- Super reactions (#9336) ([a5afc40](https://github.com/discordjs/discord.js/commit/a5afc406b965b39a9cc90ef9e0e7a4b460c4e04c)) +- Use get sticker pack endpoint (#10445) ([1b1ae2f](https://github.com/discordjs/discord.js/commit/1b1ae2f0cb339170e4c0692eb43fbc966fd64030)) +- **VoiceState:** Add methods for fetching voice state (#10442) ([9907ff9](https://github.com/discordjs/discord.js/commit/9907ff915e7c72e7e980d68bf005763a3aacad1c)) +- Application emojis (#10399) ([5d92525](https://github.com/discordjs/discord.js/commit/5d92525596a0193fe65626119bb040c2eb9e945a)) +- **Attachment:** Add `title` (#10423) ([c63bde9](https://github.com/discordjs/discord.js/commit/c63bde9479359a863be4ffa4916d683a88eb46f1)) +- Add support for Automated Message nonce handling (#10381) ([2ca187b](https://github.com/discordjs/discord.js/commit/2ca187bd34a8cf2ac4ac7f2bdaecd0506c5b40bd)) +- **GuildAuditLogsEntry:** Onboarding events (#9726) ([3654efe](https://github.com/discordjs/discord.js/commit/3654efede26e28f572313cc9f3556ae59db61ba3)) +- Premium buttons (#10353) ([4f59b74](https://github.com/discordjs/discord.js/commit/4f59b740d01b9ff2213949708a36e17da32b89c3)) +- **Message:** Add `call` (#10283) ([6803121](https://github.com/discordjs/discord.js/commit/68031210f52f25dff80558e0a12d1eceb785b47b)) +- **Invite:** Add `type` (#10280) ([17d4c78](https://github.com/discordjs/discord.js/commit/17d4c78fdecff62f616546e69ef9d8ddaea3986c)) +- **User:** Add `avatarDecorationData` (#9888) ([3b5c600](https://github.com/discordjs/discord.js/commit/3b5c600b9e3f8d40ed48f02e3c9acec7433f1cc3)) + +## Refactor + +- Use get guild role endpoint (#10443) ([bba0e72](https://github.com/discordjs/discord.js/commit/bba0e72e2283630b9f84b77d53525397036c6b31)) +- **actions:** Safer getChannel calls (#10434) ([87776bb](https://github.com/discordjs/discord.js/commit/87776bb0e8de0e04043ff61fdaf5e71cfbb69aef)) +- **GuildChannelManager:** Remove redundant edit code (#10370) ([9461045](https://github.com/discordjs/discord.js/commit/9461045e5a8b832778e7e8637f540ee51e6d1eef)) + +## Typings + +- Use `ThreadChannel` and `AnyThreadChannel` consistently (#10181) ([1f7d1f8](https://github.com/discordjs/discord.js/commit/1f7d1f8094da8d9ee797b72711a4453b29589f8b)) +- **Client:** `EventEmitter` static method overrides (#10360) ([9b707f2](https://github.com/discordjs/discord.js/commit/9b707f2b832a57d5768757fad09cf8982f64d03b)) +- Fix wrong auto moderation target type (#10391) ([bbef68d](https://github.com/discordjs/discord.js/commit/bbef68d27116a2e0aa8c545a2043c46774c97887)) +- **ApplicationCommandManager:** `Snowflake` fetch (#10366) ([b8397b2](https://github.com/discordjs/discord.js/commit/b8397b24e5a3b27639a5a0bf495c2c47b7954dad)) + # [14.15.3](https://github.com/discordjs/discord.js/compare/14.15.2...14.15.3) - (2024-06-02) ## Bug Fixes diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index 89f511b8e526..2a8a369b4f17 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "discord.js", - "version": "14.15.3", + "version": "14.16.0", "description": "A powerful library for interacting with the Discord API", "scripts": { "test": "pnpm run docs:test && pnpm run test:typescript", From 90ed51e06ee5196c5e62ac1a4ab993680260736b Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 12:00:06 +0300 Subject: [PATCH 22/42] chore: url fixing --- packages/discord.js/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/CHANGELOG.md b/packages/discord.js/CHANGELOG.md index 807d291c5599..06ada5e8d4cc 100644 --- a/packages/discord.js/CHANGELOG.md +++ b/packages/discord.js/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -# [14.16.0](https://github.com/discordjs/discord.js/compare/@discordjs/ws@1.1.1...14.16.0) - (2024-09-02) +# [14.16.0](https://github.com/discordjs/discord.js/compare/14.15.3...14.16.0) - (2024-09-01) ## Bug Fixes From ed1c1737df58350b6ca10c644344066170b8f334 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 15:12:31 +0300 Subject: [PATCH 23/42] chore: everyone goes to node 18+ --- packages/builders/README.md | 2 +- packages/builders/package.json | 2 +- packages/discord.js/README.md | 2 +- packages/discord.js/package.json | 2 +- packages/formatters/README.md | 2 +- packages/formatters/package.json | 2 +- packages/rest/README.md | 4 +--- packages/rest/package.json | 2 +- packages/util/README.md | 2 +- packages/util/package.json | 2 +- packages/voice/README.md | 2 +- packages/voice/package.json | 2 +- packages/ws/README.md | 2 +- packages/ws/package.json | 2 +- 14 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/builders/README.md b/packages/builders/README.md index dc88b7fdfb35..08d2509eda90 100644 --- a/packages/builders/README.md +++ b/packages/builders/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install @discordjs/builders diff --git a/packages/builders/package.json b/packages/builders/package.json index 2d49f7f6481b..9e5d39f20122 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -91,7 +91,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", diff --git a/packages/discord.js/README.md b/packages/discord.js/README.md index d7eb0726c9e1..d334efbb4bf6 100644 --- a/packages/discord.js/README.md +++ b/packages/discord.js/README.md @@ -29,7 +29,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install discord.js diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index 2a8a369b4f17..fdf5c9045756 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -98,7 +98,7 @@ "typescript": "~5.5.4" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "provenance": true diff --git a/packages/formatters/README.md b/packages/formatters/README.md index 65ad4b0d0e99..b1e9fe57939d 100644 --- a/packages/formatters/README.md +++ b/packages/formatters/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install @discordjs/formatters diff --git a/packages/formatters/package.json b/packages/formatters/package.json index 9e1093cf05ce..ae0ee90b051e 100644 --- a/packages/formatters/package.json +++ b/packages/formatters/package.json @@ -75,7 +75,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", diff --git a/packages/rest/README.md b/packages/rest/README.md index 6cc1e758cd6d..c7f21e812cba 100644 --- a/packages/rest/README.md +++ b/packages/rest/README.md @@ -23,9 +23,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** - -Note: native fetch (not recommended) is unavailable in this node version, either use a newer node version or use the more performant `undiciRequest` strategy (default) +**Node.js 18 or newer is required.** ```sh npm install @discordjs/rest diff --git a/packages/rest/package.json b/packages/rest/package.json index af0626d0be10..0eec7df15376 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -111,7 +111,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", diff --git a/packages/util/README.md b/packages/util/README.md index bcdbc4ce19b7..42b8eafd0087 100644 --- a/packages/util/README.md +++ b/packages/util/README.md @@ -20,7 +20,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install @discordjs/util diff --git a/packages/util/package.json b/packages/util/package.json index 26fd6945f6bc..437fa7270b3b 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -80,7 +80,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", diff --git a/packages/voice/README.md b/packages/voice/README.md index 3a2c4e3a2f13..ea682f9107a3 100644 --- a/packages/voice/README.md +++ b/packages/voice/README.md @@ -32,7 +32,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install @discordjs/voice diff --git a/packages/voice/package.json b/packages/voice/package.json index 389af180083f..cefe7ffbbf2e 100644 --- a/packages/voice/package.json +++ b/packages/voice/package.json @@ -93,7 +93,7 @@ "typescript": "~5.5.4" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", diff --git a/packages/ws/README.md b/packages/ws/README.md index 61be4e93573b..c3a9dc92931c 100644 --- a/packages/ws/README.md +++ b/packages/ws/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 18 or newer is required.** ```sh npm install @discordjs/ws diff --git a/packages/ws/package.json b/packages/ws/package.json index 2c913f43ebbd..29481ea43222 100644 --- a/packages/ws/package.json +++ b/packages/ws/package.json @@ -105,7 +105,7 @@ "zlib-sync": "^0.1.9" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "publishConfig": { "access": "public", From 18ce10a9afeadd4cbd0cd4f42cf42a54ec0c1690 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 2 Sep 2024 15:17:19 +0300 Subject: [PATCH 24/42] chore: bump major releases to node 20 --- packages/brokers/README.md | 2 +- packages/brokers/package.json | 2 +- packages/core/README.md | 2 +- packages/core/package.json | 2 +- packages/ws/README.md | 2 +- packages/ws/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/brokers/README.md b/packages/brokers/README.md index 061e642243e2..7789c86f4d00 100644 --- a/packages/brokers/README.md +++ b/packages/brokers/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 18 or newer is required.** +**Node.js 20 or newer is required.** ```sh npm install @discordjs/brokers diff --git a/packages/brokers/package.json b/packages/brokers/package.json index 0c34ece3484f..bed670f549a9 100644 --- a/packages/brokers/package.json +++ b/packages/brokers/package.json @@ -89,7 +89,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=18" + "node": ">=20" }, "publishConfig": { "access": "public", diff --git a/packages/core/README.md b/packages/core/README.md index 2fe9b334a3c4..e5363e0343af 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 18 or newer is required.** +**Node.js 20 or newer is required.** ```sh npm install @discordjs/core diff --git a/packages/core/package.json b/packages/core/package.json index bc0ad2c8c800..5a4e8449b711 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -90,7 +90,7 @@ "vitest": "^2.0.5" }, "engines": { - "node": ">=18" + "node": ">=20" }, "publishConfig": { "access": "public", diff --git a/packages/ws/README.md b/packages/ws/README.md index c3a9dc92931c..9da53cd4f250 100644 --- a/packages/ws/README.md +++ b/packages/ws/README.md @@ -23,7 +23,7 @@ ## Installation -**Node.js 18 or newer is required.** +**Node.js 20 or newer is required.** ```sh npm install @discordjs/ws diff --git a/packages/ws/package.json b/packages/ws/package.json index 29481ea43222..0957e203c1e9 100644 --- a/packages/ws/package.json +++ b/packages/ws/package.json @@ -105,7 +105,7 @@ "zlib-sync": "^0.1.9" }, "engines": { - "node": ">=18" + "node": ">=20" }, "publishConfig": { "access": "public", From 4810f7c8637dacf77d0442bd84e0d579e1f1d3bd Mon Sep 17 00:00:00 2001 From: space Date: Mon, 2 Sep 2024 23:12:28 +0200 Subject: [PATCH 25/42] fix(Transformers): pass client to recursive call (#10474) --- packages/discord.js/src/util/Transformers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/util/Transformers.js b/packages/discord.js/src/util/Transformers.js index 89d6c5e092c8..0e6148a10034 100644 --- a/packages/discord.js/src/util/Transformers.js +++ b/packages/discord.js/src/util/Transformers.js @@ -49,7 +49,7 @@ function _transformAPIMessageInteractionMetadata(client, messageInteractionMetad originalResponseMessageId: messageInteractionMetadata.original_response_message_id ?? null, interactedMessageId: messageInteractionMetadata.interacted_message_id ?? null, triggeringInteractionMetadata: messageInteractionMetadata.triggering_interaction_metadata - ? _transformAPIMessageInteractionMetadata(messageInteractionMetadata.triggering_interaction_metadata) + ? _transformAPIMessageInteractionMetadata(client, messageInteractionMetadata.triggering_interaction_metadata) : null, }; } From 9257a09abbf80558ed2d5d209a2f6bd2a4b3d799 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Tue, 3 Sep 2024 00:20:16 +0300 Subject: [PATCH 26/42] fix(Message): reacting returning undefined (#10475) --- packages/discord.js/src/client/actions/Action.js | 4 ++++ .../discord.js/src/client/actions/MessageReactionAdd.js | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/client/actions/Action.js b/packages/discord.js/src/client/actions/Action.js index 96170ee87d7e..b5f1f756b4a2 100644 --- a/packages/discord.js/src/client/actions/Action.js +++ b/packages/discord.js/src/client/actions/Action.js @@ -111,6 +111,10 @@ class GenericAction { getThreadMember(id, manager) { return this.getPayload({ user_id: id }, manager, id, Partials.ThreadMember, false); } + + spreadInjectedData(data) { + return Object.fromEntries(Object.getOwnPropertySymbols(data).map(symbol => [symbol, data[symbol]])); + } } module.exports = GenericAction; diff --git a/packages/discord.js/src/client/actions/MessageReactionAdd.js b/packages/discord.js/src/client/actions/MessageReactionAdd.js index 9c9ffbc874a0..b32f7154f102 100644 --- a/packages/discord.js/src/client/actions/MessageReactionAdd.js +++ b/packages/discord.js/src/client/actions/MessageReactionAdd.js @@ -23,7 +23,13 @@ class MessageReactionAdd extends Action { if (!user) return false; // Verify channel - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id, user_id: data.user_id }); + const channel = this.getChannel({ + id: data.channel_id, + guild_id: data.guild_id, + user_id: data.user_id, + ...this.spreadInjectedData(data), + }); + if (!channel?.isTextBased()) return false; // Verify message From a11ff75631190dbb9c3f29cd01b51658050df20d Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Tue, 3 Sep 2024 00:24:53 +0300 Subject: [PATCH 27/42] chore(discord.js): release discord.js@14.16.1 (#10476) --- packages/discord.js/CHANGELOG.md | 7 +++++++ packages/discord.js/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/CHANGELOG.md b/packages/discord.js/CHANGELOG.md index 06ada5e8d4cc..324e4ca9b79f 100644 --- a/packages/discord.js/CHANGELOG.md +++ b/packages/discord.js/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +# [14.16.1](https://github.com/discordjs/discord.js/compare/14.16.0...14.16.1) - (2024-09-02) + +## Bug Fixes + +- **Message:** Reacting returning undefined (#10475) ([9257a09](https://github.com/discordjs/discord.js/commit/9257a09abbf80558ed2d5d209a2f6bd2a4b3d799)) by @vladfrangu +- **Transformers:** Pass client to recursive call (#10474) ([4810f7c](https://github.com/discordjs/discord.js/commit/4810f7c8637dacf77d0442bd84e0d579e1f1d3bd)) by @SpaceEEC + # [14.16.0](https://github.com/discordjs/discord.js/compare/14.15.3...14.16.0) - (2024-09-01) ## Bug Fixes diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index fdf5c9045756..2cad1d851e0e 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "discord.js", - "version": "14.16.0", + "version": "14.16.1", "description": "A powerful library for interacting with the Discord API", "scripts": { "test": "pnpm run docs:test && pnpm run test:typescript", From 4594896b5404c6a34e07544951c59ff8f3657184 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Wed, 4 Sep 2024 00:20:01 +0200 Subject: [PATCH 28/42] docs(ApplicationEmojiManager): fix fetch example (#10480) * docs(ApplicationEmojiManager): fix fetch example * docs: requested changes --- packages/discord.js/src/managers/ApplicationEmojiManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/discord.js/src/managers/ApplicationEmojiManager.js b/packages/discord.js/src/managers/ApplicationEmojiManager.js index 22e1d7c1a7cb..d53ee2fb1abc 100644 --- a/packages/discord.js/src/managers/ApplicationEmojiManager.js +++ b/packages/discord.js/src/managers/ApplicationEmojiManager.js @@ -65,12 +65,12 @@ class ApplicationEmojiManager extends CachedManager { * @returns {Promise>} * @example * // Fetch all emojis from the application - * message.application.emojis.fetch() + * application.emojis.fetch() * .then(emojis => console.log(`There are ${emojis.size} emojis.`)) * .catch(console.error); * @example * // Fetch a single emoji - * message.application.emojis.fetch('222078108977594368') + * application.emojis.fetch('222078108977594368') * .then(emoji => console.log(`The emoji name is: ${emoji.name}`)) * .catch(console.error); */ From aff772c7aa3b3de58780a94588d1f3576a434f32 Mon Sep 17 00:00:00 2001 From: Qjuh <76154676+Qjuh@users.noreply.github.com> Date: Thu, 5 Sep 2024 00:16:54 +0200 Subject: [PATCH 29/42] types: export GroupDM helper type (#10478) * types: export GroupDM helper type * refactor: rename type --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/discord.js/typings/index.d.ts | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 1dc3d97ea94a..a0c3b64900b1 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2192,27 +2192,27 @@ export class Message extends Base { public createMessageComponentCollector( options?: MessageCollectorOptionsParams, ): InteractionCollector[ComponentType]>; - public delete(): Promise>>; + public delete(): Promise>>; public edit( content: string | MessageEditOptions | MessagePayload, - ): Promise>>; + ): Promise>>; public equals(message: Message, rawData: unknown): boolean; - public fetchReference(): Promise>>; + public fetchReference(): Promise>>; public fetchWebhook(): Promise; - public crosspost(): Promise>>; - public fetch(force?: boolean): Promise>>; - public pin(reason?: string): Promise>>; + public crosspost(): Promise>>; + public fetch(force?: boolean): Promise>>; + public pin(reason?: string): Promise>>; public react(emoji: EmojiIdentifierResolvable): Promise; - public removeAttachments(): Promise>>; + public removeAttachments(): Promise>>; public reply( options: string | MessagePayload | MessageReplyOptions, - ): Promise>>; + ): Promise>>; public resolveComponent(customId: string): MessageActionRowComponent | null; public startThread(options: StartThreadOptions): Promise>; - public suppressEmbeds(suppress?: boolean): Promise>>; + public suppressEmbeds(suppress?: boolean): Promise>>; public toJSON(): unknown; public toString(): string; - public unpin(reason?: string): Promise>>; + public unpin(reason?: string): Promise>>; public inGuild(): this is Message; } @@ -5270,7 +5270,7 @@ export interface GuildMembersChunk { nonce: string | undefined; } -type NonPartialGroupDMChannel = Structure & { +export type OmitPartialGroupDMChannel = Structure & { channel: Exclude; }; @@ -5316,17 +5316,17 @@ export interface ClientEvents { guildUpdate: [oldGuild: Guild, newGuild: Guild]; inviteCreate: [invite: Invite]; inviteDelete: [invite: Invite]; - messageCreate: [message: NonPartialGroupDMChannel]; - messageDelete: [message: NonPartialGroupDMChannel]; + messageCreate: [message: OmitPartialGroupDMChannel]; + messageDelete: [message: OmitPartialGroupDMChannel]; messagePollVoteAdd: [pollAnswer: PollAnswer, userId: Snowflake]; messagePollVoteRemove: [pollAnswer: PollAnswer, userId: Snowflake]; messageReactionRemoveAll: [ - message: NonPartialGroupDMChannel, + message: OmitPartialGroupDMChannel, reactions: ReadonlyCollection, ]; messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction]; messageDeleteBulk: [ - messages: ReadonlyCollection>, + messages: ReadonlyCollection>, channel: GuildTextBasedChannel, ]; messageReactionAdd: [ From c13f18e90eb6eb315397c095e948993856428757 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Thu, 5 Sep 2024 00:22:10 +0200 Subject: [PATCH 30/42] docs(Message): mark `interaction` as deprecated (#10481) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/discord.js/src/structures/Message.js | 1 + packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 0fe2f762e3ac..276a2cb340a8 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -426,6 +426,7 @@ class Message extends Base { /** * Partial data of the interaction that this message is a reply to * @type {?MessageInteraction} + * @deprecated Use {@link Message#interactionMetadata} instead. */ this.interaction = { id: data.interaction.id, diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index a0c3b64900b1..cc3f0e454fc6 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -6416,6 +6416,7 @@ export interface MessageInteractionMetadata { triggeringInteractionMetadata: MessageInteractionMetadata | null; } +/** @deprecated Use {@link MessageInteractionMetadata} instead. */ export interface MessageInteraction { id: Snowflake; type: InteractionType; From dea68400a38edb90b8b4242d64be14968943130d Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Fri, 6 Sep 2024 10:16:38 +0300 Subject: [PATCH 31/42] fix: type guard for sendable text-based channels (#10482) * fix: type-guard for sendable text-based channels * chore: suggested change * Update packages/discord.js/typings/index.test-d.ts Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> * fix: make isSendable strictly check for `.send` * fix: tests --------- Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- .../discord.js/src/structures/BaseChannel.js | 8 ++++++++ packages/discord.js/src/util/Constants.js | 17 ++++++++++++++++- packages/discord.js/typings/index.d.ts | 8 +++++++- packages/discord.js/typings/index.test-d.ts | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/discord.js/src/structures/BaseChannel.js b/packages/discord.js/src/structures/BaseChannel.js index 2b179d3574bc..ebb95682819c 100644 --- a/packages/discord.js/src/structures/BaseChannel.js +++ b/packages/discord.js/src/structures/BaseChannel.js @@ -155,6 +155,14 @@ class BaseChannel extends Base { return 'availableTags' in this; } + /** + * Indicates whether this channel is sendable. + * @returns {boolean} + */ + isSendable() { + return 'send' in this; + } + toJSON(...props) { return super.toJSON({ createdTimestamp: true }, ...props); } diff --git a/packages/discord.js/src/util/Constants.js b/packages/discord.js/src/util/Constants.js index e64d807e4300..8babdfdbea68 100644 --- a/packages/discord.js/src/util/Constants.js +++ b/packages/discord.js/src/util/Constants.js @@ -117,9 +117,24 @@ exports.GuildTextBasedChannelTypes = [ * * {@link ChannelType.PrivateThread} * * {@link ChannelType.GuildVoice} * * {@link ChannelType.GuildStageVoice} + * * {@link ChannelType.GroupDM} * @typedef {ChannelType[]} TextBasedChannelTypes */ -exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelType.DM]; +exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelType.DM, ChannelType.GroupDM]; + +/** + * The types of channels that are text-based and can have messages sent into. The available types are: + * * {@link ChannelType.DM} + * * {@link ChannelType.GuildText} + * * {@link ChannelType.GuildAnnouncement} + * * {@link ChannelType.AnnouncementThread} + * * {@link ChannelType.PublicThread} + * * {@link ChannelType.PrivateThread} + * * {@link ChannelType.GuildVoice} + * * {@link ChannelType.GuildStageVoice} + * @typedef {ChannelType[]} SendableChannels + */ +exports.SendableChannels = [...exports.GuildTextBasedChannelTypes, ChannelType.DM]; /** * The types of channels that are threads. The available types are: diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index cc3f0e454fc6..2ac27e78a990 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -975,6 +975,7 @@ export abstract class BaseChannel extends Base { public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel; public isVoiceBased(): this is VoiceBasedChannel; public isThreadOnly(): this is ThreadOnlyChannel; + public isSendable(): this is SendableChannels; public toString(): ChannelMention | UserMention; } @@ -3867,6 +3868,7 @@ export const Constants: { SweeperKeys: SweeperKey[]; NonSystemMessageTypes: NonSystemMessageType[]; TextBasedChannelTypes: TextBasedChannelTypes[]; + SendableChannels: SendableChannelTypes[]; GuildTextBasedChannelTypes: GuildTextBasedChannelTypes[]; ThreadChannelTypes: ThreadChannelType[]; VoiceBasedChannelTypes: VoiceBasedChannelTypes[]; @@ -6879,11 +6881,15 @@ export type Channel = export type TextBasedChannel = Exclude, ForumChannel | MediaChannel>; +export type SendableChannels = Extract any }>; + export type TextBasedChannels = TextBasedChannel; export type TextBasedChannelTypes = TextBasedChannel['type']; -export type GuildTextBasedChannelTypes = Exclude; +export type GuildTextBasedChannelTypes = Exclude; + +export type SendableChannelTypes = SendableChannels['type']; export type VoiceBasedChannel = Extract; diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 02011850550a..1f499be832d6 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -209,6 +209,7 @@ import { ApplicationEmoji, ApplicationEmojiManager, StickerPack, + SendableChannels, } from '.'; import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd'; import type { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders'; @@ -2593,3 +2594,17 @@ declare const poll: Poll; expectType>(await client.fetchStickerPacks()); expectType>(await client.fetchStickerPacks({})); expectType(await client.fetchStickerPacks({ packId: snowflake })); + +client.on('interactionCreate', interaction => { + if (!interaction.channel) { + return; + } + + // @ts-expect-error + interaction.channel.send(); + + if (interaction.channel.isSendable()) { + expectType(interaction.channel); + interaction.channel.send({ embeds: [] }); + } +}); From 8a74f144ac9e33e2bbd4dca279f186908901d2d9 Mon Sep 17 00:00:00 2001 From: Denis Cristea Date: Fri, 6 Sep 2024 16:12:19 +0300 Subject: [PATCH 32/42] chore: pin builders in discord.js (#10490) --- packages/discord.js/package.json | 2 +- pnpm-lock.yaml | 224 ++++++++++++++++--------------- 2 files changed, 116 insertions(+), 110 deletions(-) diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index 2cad1d851e0e..1301e18e02b8 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -65,7 +65,7 @@ "homepage": "https://discord.js.org", "funding": "https://github.com/discordjs/discord.js?sponsor", "dependencies": { - "@discordjs/builders": "workspace:^", + "@discordjs/builders": "^1.9.0", "@discordjs/collection": "1.5.3", "@discordjs/formatters": "workspace:^", "@discordjs/rest": "workspace:^", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52c2a55ea0bf..d809a09d8581 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -920,8 +920,8 @@ importers: packages/discord.js: dependencies: '@discordjs/builders': - specifier: workspace:^ - version: link:../builders + specifier: ^1.9.0 + version: 1.9.0 '@discordjs/collection': specifier: 1.5.3 version: 1.5.3 @@ -1461,25 +1461,25 @@ importers: version: 4.1.0 '@storybook/addon-essentials': specifier: ^8.1.5 - version: 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + version: 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@storybook/addon-interactions': specifier: ^8.1.5 - version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) + version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) '@storybook/addon-links': specifier: ^8.1.5 - version: 8.2.9(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + version: 8.2.9(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@storybook/addon-styling': specifier: ^1.3.7 version: 1.3.7(@types/react-dom@18.3.0)(@types/react@18.3.4)(encoding@0.1.13)(postcss@8.4.41)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.4) '@storybook/blocks': specifier: ^8.1.5 - version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@storybook/react': specifier: ^8.1.5 - version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4) + version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4) '@storybook/react-vite': specifier: ^8.1.5 - version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.21.0)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6)) + version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.21.0)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6)) '@storybook/testing-library': specifier: ^0.2.2 version: 0.2.2 @@ -1527,7 +1527,7 @@ importers: version: 15.8.1 storybook: specifier: ^8.1.5 - version: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + version: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) turbo: specifier: ^2.0.14 version: 2.0.14 @@ -2613,6 +2613,10 @@ packages: resolution: {integrity: sha512-t58AeNg6+mvyMnBHyPC6JQqWMW0Iwyb+vlpBz4V0d0iDY9H8gGCnLFg9vtN1nC+JXfTXBlf9efu9unMUeaPCiA==} engines: {node: '>=18.18.0'} + '@discordjs/builders@1.9.0': + resolution: {integrity: sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==} + engines: {node: '>=18'} + '@discordjs/collection@1.5.3': resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} engines: {node: '>=16.11.0'} @@ -2621,6 +2625,10 @@ packages: resolution: {integrity: sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw==} engines: {node: '>=18'} + '@discordjs/formatters@0.5.0': + resolution: {integrity: sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==} + engines: {node: '>=18'} + '@discordjs/rest@2.3.0': resolution: {integrity: sha512-C1kAJK8aSYRv3ZwMG8cvrrW4GN0g5eMdP8AuN8ODH5DyOCbHgJspze1my3xHOAgwLJdKUbWNVyAeJ9cEdduqIg==} engines: {node: '>=16.11.0'} @@ -2629,6 +2637,10 @@ packages: resolution: {integrity: sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg==} engines: {node: '>=16.11.0'} + '@discordjs/util@1.1.1': + resolution: {integrity: sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g==} + engines: {node: '>=18'} + '@discordjs/ws@1.1.1': resolution: {integrity: sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==} engines: {node: '>=16.11.0'} @@ -3146,11 +3158,6 @@ packages: engines: {node: '>=v18'} hasBin: true - '@favware/cliff-jumper@4.0.3': - resolution: {integrity: sha512-vRFP87hW/UM4ryVxKFlknV7ZeYwFCzMizjBBpIJ51WSLsmxehOKV365n79IY2r6lVmxMgDbOZ0AZkB8AfBzHPw==} - engines: {node: '>=v18'} - hasBin: true - '@favware/colorette-spinner@1.0.1': resolution: {integrity: sha512-PPYtcLzhSafdylp8NBOxMCYIcLqTUMNiQc7ciBoAIvxNG2egM+P7e2nNPui5+Svyk89Q+Tnbrp139ZRIIBw3IA==} engines: {node: '>=v16'} @@ -14828,10 +14835,24 @@ snapshots: tar-stream: 3.1.7 which: 4.0.0 + '@discordjs/builders@1.9.0': + dependencies: + '@discordjs/formatters': 0.5.0 + '@discordjs/util': 1.1.1 + '@sapphire/shapeshift': 4.0.0 + discord-api-types: 0.37.97 + fast-deep-equal: 3.1.3 + ts-mixer: 6.0.4 + tslib: 2.6.3 + '@discordjs/collection@1.5.3': {} '@discordjs/collection@2.1.0': {} + '@discordjs/formatters@0.5.0': + dependencies: + discord-api-types: 0.37.97 + '@discordjs/rest@2.3.0': dependencies: '@discordjs/collection': 2.1.0 @@ -14846,6 +14867,8 @@ snapshots: '@discordjs/util@1.1.0': {} + '@discordjs/util@1.1.1': {} + '@discordjs/ws@1.1.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)': dependencies: '@discordjs/collection': 2.1.0 @@ -15180,23 +15203,6 @@ snapshots: semver: 7.6.3 smol-toml: 1.3.0 - '@favware/cliff-jumper@4.0.3': - dependencies: - '@favware/colorette-spinner': 1.0.1 - '@octokit/auth-token': 5.1.1 - '@octokit/core': 6.1.2 - '@octokit/plugin-retry': 7.1.1(@octokit/core@6.1.2) - '@sapphire/result': 2.6.6 - '@sapphire/utilities': 3.16.2 - colorette: 2.0.20 - commander: 12.1.0 - conventional-recommended-bump: 10.0.0 - execa: 9.3.1 - git-cliff: 2.4.0 - js-yaml: 4.1.0 - semver: 7.6.3 - smol-toml: 1.3.0 - '@favware/colorette-spinner@1.0.1': dependencies: colorette: 2.0.20 @@ -18174,76 +18180,76 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 - '@storybook/addon-actions@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-actions@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 '@types/uuid': 9.0.8 dequal: 2.0.3 polished: 4.3.1 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) uuid: 9.0.1 - '@storybook/addon-backgrounds@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-backgrounds@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 memoizerific: 1.11.3 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 - '@storybook/addon-controls@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-controls@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: dequal: 2.0.3 lodash: 4.17.21 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 - '@storybook/addon-docs@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-docs@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@babel/core': 7.25.2 '@mdx-js/react': 3.0.1(@types/react@18.3.4)(react@18.3.1) - '@storybook/blocks': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/csf-plugin': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/blocks': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/csf-plugin': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@storybook/global': 5.0.0 - '@storybook/react-dom-shim': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/react-dom-shim': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@types/react': 18.3.4 fs-extra: 11.2.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rehype-external-links: 3.0.0 rehype-slug: 6.0.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 transitivePeerDependencies: - supports-color - '@storybook/addon-essentials@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': - dependencies: - '@storybook/addon-actions': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-backgrounds': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-controls': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-docs': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-highlight': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-measure': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-outline': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-toolbars': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/addon-viewport': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + '@storybook/addon-essentials@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + dependencies: + '@storybook/addon-actions': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-backgrounds': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-controls': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-docs': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-highlight': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-measure': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-outline': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-toolbars': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/addon-viewport': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 transitivePeerDependencies: - supports-color - '@storybook/addon-highlight@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-highlight@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) - '@storybook/addon-interactions@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': + '@storybook/addon-interactions@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': dependencies: '@storybook/global': 5.0.0 - '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/test': 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) + '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/test': 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) polished: 4.3.1 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 transitivePeerDependencies: - '@jest/globals' @@ -18252,25 +18258,25 @@ snapshots: - jest - vitest - '@storybook/addon-links@8.2.9(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-links@8.2.9(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/csf': 0.1.11 '@storybook/global': 5.0.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 optionalDependencies: react: 18.3.1 - '@storybook/addon-measure@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-measure@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) tiny-invariant: 1.3.3 - '@storybook/addon-outline@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-outline@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 '@storybook/addon-styling@1.3.7(@types/react-dom@18.3.0)(@types/react@18.3.4)(encoding@0.1.13)(postcss@8.4.41)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.5.4)': @@ -18309,14 +18315,14 @@ snapshots: - supports-color - typescript - '@storybook/addon-toolbars@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-toolbars@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) - '@storybook/addon-viewport@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/addon-viewport@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: memoizerific: 1.11.3 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@storybook/api@7.6.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -18326,7 +18332,7 @@ snapshots: - react - react-dom - '@storybook/blocks@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/blocks@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/csf': 0.1.11 '@storybook/global': 5.0.0 @@ -18339,7 +18345,7 @@ snapshots: memoizerific: 1.11.3 polished: 4.3.1 react-colorful: 5.6.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) telejson: 7.2.0 ts-dedent: 2.2.0 util-deprecate: 1.0.2 @@ -18347,9 +18353,9 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/builder-vite@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6))': + '@storybook/builder-vite@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6))': dependencies: - '@storybook/csf-plugin': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/csf-plugin': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@types/find-cache-dir': 3.2.1 browser-assert: 1.2.1 es-module-lexer: 1.5.4 @@ -18357,7 +18363,7 @@ snapshots: find-cache-dir: 3.3.2 fs-extra: 11.2.0 magic-string: 0.30.11 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 vite: 5.4.2(@types/node@18.19.45)(terser@5.31.6) optionalDependencies: @@ -18401,7 +18407,7 @@ snapshots: '@types/cross-spawn': 6.0.6 cross-spawn: 7.0.3 globby: 14.0.2 - jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2)) + jscodeshift: 0.15.2(@babel/preset-env@7.25.4) lodash: 4.17.21 prettier: 3.3.3 recast: 0.23.9 @@ -18429,9 +18435,9 @@ snapshots: - '@types/react' - '@types/react-dom' - '@storybook/components@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/components@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@storybook/core-common@7.6.20(encoding@0.1.13)': dependencies: @@ -18488,9 +18494,9 @@ snapshots: - supports-color - utf-8-validate - '@storybook/csf-plugin@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/csf-plugin@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) unplugin: 1.12.2 '@storybook/csf@0.1.11': @@ -18504,11 +18510,11 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/instrumenter@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/instrumenter@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@storybook/global': 5.0.0 '@vitest/utils': 1.6.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) util: 0.12.5 '@storybook/manager-api@7.6.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': @@ -18551,9 +18557,9 @@ snapshots: - react - react-dom - '@storybook/manager-api@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/manager-api@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@storybook/node-logger@7.6.20': {} @@ -18574,29 +18580,29 @@ snapshots: ts-dedent: 2.2.0 util-deprecate: 1.0.2 - '@storybook/preview-api@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/preview-api@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) - '@storybook/react-dom-shim@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/react-dom-shim@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) - '@storybook/react-vite@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.21.0)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6))': + '@storybook/react-vite@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.21.0)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6))': dependencies: '@joshwooding/vite-plugin-react-docgen-typescript': 0.3.1(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6)) '@rollup/pluginutils': 5.1.0(rollup@4.21.0) - '@storybook/builder-vite': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6)) - '@storybook/react': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4) + '@storybook/builder-vite': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)(vite@5.4.2(@types/node@18.19.45)(terser@5.31.6)) + '@storybook/react': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4) find-up: 5.0.0 magic-string: 0.30.11 react: 18.3.1 react-docgen: 7.0.3 react-dom: 18.3.1(react@18.3.1) resolve: 1.22.8 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) tsconfig-paths: 4.2.0 vite: 5.4.2(@types/node@18.19.45)(terser@5.31.6) transitivePeerDependencies: @@ -18606,14 +18612,14 @@ snapshots: - typescript - vite-plugin-glimmerx - '@storybook/react@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)': + '@storybook/react@8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(typescript@5.5.4)': dependencies: - '@storybook/components': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/components': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@storybook/global': 5.0.0 - '@storybook/manager-api': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/preview-api': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/react-dom-shim': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) - '@storybook/theming': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/manager-api': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/preview-api': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/react-dom-shim': 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/theming': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@types/escodegen': 0.0.6 '@types/estree': 0.0.51 '@types/node': 18.19.45 @@ -18628,7 +18634,7 @@ snapshots: react-dom: 18.3.1(react@18.3.1) react-element-to-jsx-string: 15.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) semver: 7.5.4 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) ts-dedent: 2.2.0 type-fest: 2.19.0 util-deprecate: 1.0.2 @@ -18647,16 +18653,16 @@ snapshots: memoizerific: 1.11.3 qs: 6.13.0 - '@storybook/test@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': + '@storybook/test@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': dependencies: '@storybook/csf': 0.1.11 - '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@testing-library/dom': 10.1.0 - '@testing-library/jest-dom': 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) + '@testing-library/jest-dom': 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6)) '@testing-library/user-event': 14.5.2(@testing-library/dom@10.1.0) '@vitest/expect': 1.6.0 '@vitest/spy': 1.6.0 - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) util: 0.12.5 transitivePeerDependencies: - '@jest/globals' @@ -18689,9 +18695,9 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/theming@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))': + '@storybook/theming@8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: - storybook: 8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4) + storybook: 8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@storybook/types@7.6.17': dependencies: @@ -18763,7 +18769,7 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 - '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': + '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@18.19.45))(vitest@2.0.5(@edge-runtime/vm@3.2.0)(@types/node@18.19.45)(happy-dom@14.12.3)(terser@5.31.6))': dependencies: '@adobe/css-tools': 4.4.0 '@babel/runtime': 7.25.4 @@ -24296,7 +24302,7 @@ snapshots: jsbn@1.1.0: {} - jscodeshift@0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2)): + jscodeshift@0.15.2(@babel/preset-env@7.25.4): dependencies: '@babel/core': 7.25.2 '@babel/parser': 7.25.4 @@ -27807,7 +27813,7 @@ snapshots: store2@2.14.3: {} - storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4): + storybook@8.2.9(@babel/preset-env@7.25.4)(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: '@babel/core': 7.25.2 '@babel/types': 7.25.4 @@ -27827,7 +27833,7 @@ snapshots: fs-extra: 11.2.0 giget: 1.2.3 globby: 14.0.2 - jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2)) + jscodeshift: 0.15.2(@babel/preset-env@7.25.4) leven: 3.1.0 ora: 5.4.1 prettier: 3.3.3 From 799fa54fa4434144855be2f7a0bbac6ff8ce9d0b Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Tue, 10 Sep 2024 21:23:53 +0200 Subject: [PATCH 33/42] docs: update discord documentation links (#10484) --- packages/core/src/api/channel.ts | 28 +++++++++---------- packages/discord.js/src/structures/Message.js | 2 +- .../structures/interfaces/TextBasedChannel.js | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/core/src/api/channel.ts b/packages/core/src/api/channel.ts index f97a242be591..fe8aa20c68b9 100644 --- a/packages/core/src/api/channel.ts +++ b/packages/core/src/api/channel.ts @@ -45,7 +45,7 @@ export class ChannelsAPI { /** * Sends a message in a channel * - * @see {@link https://discord.com/developers/docs/resources/channel#create-message} + * @see {@link https://discord.com/developers/docs/resources/message#create-message} * @param channelId - The id of the channel to send the message in * @param body - The data for sending the message * @param options - The options for sending the message @@ -65,7 +65,7 @@ export class ChannelsAPI { /** * Edits a message * - * @see {@link https://discord.com/developers/docs/resources/channel#edit-message} + * @see {@link https://discord.com/developers/docs/resources/message#edit-message} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to edit * @param body - The data for editing the message @@ -87,7 +87,7 @@ export class ChannelsAPI { /** * Fetches the reactions for a message * - * @see {@link https://discord.com/developers/docs/resources/channel#get-reactions} + * @see {@link https://discord.com/developers/docs/resources/message#get-reactions} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to get the reactions for * @param emoji - The emoji to get the reactions for @@ -110,7 +110,7 @@ export class ChannelsAPI { /** * Deletes a reaction for the current user * - * @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction} + * @see {@link https://discord.com/developers/docs/resources/message#delete-own-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reaction for * @param emoji - The emoji to delete the reaction for @@ -130,7 +130,7 @@ export class ChannelsAPI { /** * Deletes a reaction for a user * - * @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction} + * @see {@link https://discord.com/developers/docs/resources/message#delete-user-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reaction for * @param emoji - The emoji to delete the reaction for @@ -152,7 +152,7 @@ export class ChannelsAPI { /** * Deletes all reactions for a message * - * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions} + * @see {@link https://discord.com/developers/docs/resources/message#delete-all-reactions} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reactions for * @param options - The options for deleting the reactions @@ -168,7 +168,7 @@ export class ChannelsAPI { /** * Deletes all reactions of an emoji for a message * - * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji} + * @see {@link https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reactions for * @param emoji - The emoji to delete the reactions for @@ -186,7 +186,7 @@ export class ChannelsAPI { /** * Adds a reaction to a message * - * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction} + * @see {@link https://discord.com/developers/docs/resources/message#create-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to add the reaction to * @param emoji - The emoji to add the reaction with @@ -242,7 +242,7 @@ export class ChannelsAPI { /** * Fetches the messages of a channel * - * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages} + * @see {@link https://discord.com/developers/docs/resources/message#get-channel-messages} * @param channelId - The id of the channel to fetch messages from * @param query - The query options for fetching messages * @param options - The options for fetching the messages @@ -299,7 +299,7 @@ export class ChannelsAPI { /** * Deletes a message * - * @see {@link https://discord.com/developers/docs/resources/channel#delete-message} + * @see {@link https://discord.com/developers/docs/resources/message#delete-message} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete * @param options - The options for deleting the message @@ -315,7 +315,7 @@ export class ChannelsAPI { /** * Bulk deletes messages * - * @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages} + * @see {@link https://discord.com/developers/docs/resources/message#bulk-delete-messages} * @param channelId - The id of the channel the messages are in * @param messageIds - The ids of the messages to delete * @param options - The options for deleting the messages @@ -331,7 +331,7 @@ export class ChannelsAPI { /** * Fetches a message * - * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message} + * @see {@link https://discord.com/developers/docs/resources/message#get-channel-message} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to fetch * @param options - The options for fetching the message @@ -345,7 +345,7 @@ export class ChannelsAPI { /** * Crossposts a message * - * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message} + * @see {@link https://discord.com/developers/docs/resources/message#crosspost-message} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to crosspost * @param options - The options for crossposting the message @@ -452,7 +452,7 @@ export class ChannelsAPI { /** * Creates a new forum post * - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel} + * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} * @param channelId - The id of the forum channel to start the thread in * @param body - The data for starting the thread * @param options - The options for starting the thread diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 276a2cb340a8..8e7ee42f79fb 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -359,7 +359,7 @@ class Message extends Base { * * {@link MessageType.ChannelFollowAdd} * * {@link MessageType.Reply} * * {@link MessageType.ThreadStarterMessage} - * @see {@link https://discord.com/developers/docs/resources/channel#message-types} + * @see {@link https://discord.com/developers/docs/resources/message#message-object-message-types} * @typedef {Object} MessageReference * @property {Snowflake} channelId The channel id that was referenced * @property {Snowflake|undefined} guildId The guild id that was referenced diff --git a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js index f3f2bf8d6a0b..c3f5a9e6c573 100644 --- a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js +++ b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js @@ -75,7 +75,7 @@ class TextBasedChannel { * @property {?string} [content=''] The content for the message. This can only be `null` when editing a message. * @property {Array<(EmbedBuilder|Embed|APIEmbed)>} [embeds] The embeds for the message * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content - * (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details) + * (see [here](https://discord.com/developers/docs/resources/message#allowed-mentions-object) for more details) * @property {Array<(AttachmentBuilder|Attachment|AttachmentPayload|BufferResolvable)>} [files] * The files to send with the message. * @property {Array<(ActionRowBuilder|ActionRow|APIActionRowComponent)>} [components] From 3c74aa204909323ff6d05991438bee2c583e838b Mon Sep 17 00:00:00 2001 From: Ryan Munro Date: Wed, 11 Sep 2024 17:40:54 +1000 Subject: [PATCH 34/42] fix(ApplicationCommand): incorrect comparison in equals method (#10497) --- packages/discord.js/src/structures/ApplicationCommand.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js index 881822b54a70..37eff9e46d5c 100644 --- a/packages/discord.js/src/structures/ApplicationCommand.js +++ b/packages/discord.js/src/structures/ApplicationCommand.js @@ -418,7 +418,7 @@ class ApplicationCommand extends Base { command.descriptionLocalizations ?? command.description_localizations ?? {}, this.descriptionLocalizations ?? {}, ) || - !isEqual(command.integrationTypes ?? command.integration_types ?? [], this.integrationTypes ?? {}) || + !isEqual(command.integrationTypes ?? command.integration_types ?? [], this.integrationTypes ?? []) || !isEqual(command.contexts ?? [], this.contexts ?? []) ) { return false; From d9d578391ab06c1f0060e6a16aaa198f2dcf7bf2 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Thu, 12 Sep 2024 11:18:05 +0300 Subject: [PATCH 35/42] chore(discord.js): release discord.js@14.16.2 (#10500) --- packages/discord.js/CHANGELOG.md | 17 +++++++++++++++++ packages/discord.js/package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/CHANGELOG.md b/packages/discord.js/CHANGELOG.md index 324e4ca9b79f..f435d2fee4c9 100644 --- a/packages/discord.js/CHANGELOG.md +++ b/packages/discord.js/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. +# [14.16.2](https://github.com/discordjs/discord.js/compare/14.16.1...14.16.2) - (2024-09-12) + +## Bug Fixes + +- **ApplicationCommand:** Incorrect comparison in equals method (#10497) ([3c74aa2](https://github.com/discordjs/discord.js/commit/3c74aa204909323ff6d05991438bee2c583e838b)) by @monbrey +- Type guard for sendable text-based channels (#10482) ([dea6840](https://github.com/discordjs/discord.js/commit/dea68400a38edb90b8b4242d64be14968943130d)) by @vladfrangu + +## Documentation + +- Update discord documentation links (#10484) ([799fa54](https://github.com/discordjs/discord.js/commit/799fa54fa4434144855be2f7a0bbac6ff8ce9d0b)) by @sdanialraza +- **Message:** Mark `interaction` as deprecated (#10481) ([c13f18e](https://github.com/discordjs/discord.js/commit/c13f18e90eb6eb315397c095e948993856428757)) by @sdanialraza +- **ApplicationEmojiManager:** Fix fetch example (#10480) ([4594896](https://github.com/discordjs/discord.js/commit/4594896b5404c6a34e07544951c59ff8f3657184)) by @sdanialraza + +## Typings + +- Export GroupDM helper type (#10478) ([aff772c](https://github.com/discordjs/discord.js/commit/aff772c7aa3b3de58780a94588d1f3576a434f32)) by @Qjuh + # [14.16.1](https://github.com/discordjs/discord.js/compare/14.16.0...14.16.1) - (2024-09-02) ## Bug Fixes diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index 1301e18e02b8..a9dc7fd671ba 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "discord.js", - "version": "14.16.1", + "version": "14.16.2", "description": "A powerful library for interacting with the Discord API", "scripts": { "test": "pnpm run docs:test && pnpm run test:typescript", From 495bc6034574ae1247a5c80bd94054cd5d6d76e7 Mon Sep 17 00:00:00 2001 From: Almeida Date: Thu, 12 Sep 2024 22:24:07 +0100 Subject: [PATCH 36/42] fix: docs search (#10501) --- apps/website/src/util/fetchDependencies.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/website/src/util/fetchDependencies.ts b/apps/website/src/util/fetchDependencies.ts index 4b91ebe64059..551baaf6a181 100644 --- a/apps/website/src/util/fetchDependencies.ts +++ b/apps/website/src/util/fetchDependencies.ts @@ -20,7 +20,7 @@ export async function fetchDependencies({ return Object.entries(parsedDependencies) .filter(([key]) => key.startsWith('@discordjs/') && !key.includes('api-extractor')) - .map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${value.replaceAll('.', '-')}`); + .map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${sanitizeVersion(value)}`); } catch { return []; } @@ -36,8 +36,12 @@ export async function fetchDependencies({ return Object.entries(parsedDependencies) .filter(([key]) => key.startsWith('@discordjs/') && !key.includes('api-extractor')) - .map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${value.replaceAll('.', '-')}`); + .map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${sanitizeVersion(value)}`); } catch { return []; } } + +function sanitizeVersion(version: string) { + return version.replaceAll('.', '-').replace(/^[\^~]/, ''); +} From 2adee06b6e92b7854ebb1c2bfd04940aab68dd10 Mon Sep 17 00:00:00 2001 From: Qjuh <76154676+Qjuh@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:14:03 +0200 Subject: [PATCH 37/42] fix: `GuildChannel#guildId` not being patched to `undefined` (#10505) * fix: `GuildChannel#guildId` not being patched to `undefined` * fix: guildId to guild_id check --- packages/discord.js/src/client/actions/MessageCreate.js | 6 +++++- packages/discord.js/src/client/actions/MessageDelete.js | 2 +- .../discord.js/src/client/actions/MessagePollVoteAdd.js | 2 +- .../discord.js/src/client/actions/MessagePollVoteRemove.js | 2 +- .../discord.js/src/client/actions/MessageReactionAdd.js | 2 +- .../discord.js/src/client/actions/MessageReactionRemove.js | 6 +++++- .../src/client/actions/MessageReactionRemoveAll.js | 2 +- .../src/client/actions/MessageReactionRemoveEmoji.js | 2 +- packages/discord.js/src/client/actions/MessageUpdate.js | 2 +- packages/discord.js/src/client/actions/TypingStart.js | 2 +- 10 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/discord.js/src/client/actions/MessageCreate.js b/packages/discord.js/src/client/actions/MessageCreate.js index 2babdaf3b287..cba5ab7bf0e0 100644 --- a/packages/discord.js/src/client/actions/MessageCreate.js +++ b/packages/discord.js/src/client/actions/MessageCreate.js @@ -6,7 +6,11 @@ const Events = require('../../util/Events'); class MessageCreateAction extends Action { handle(data) { const client = this.client; - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id, author: data.author }); + const channel = this.getChannel({ + id: data.channel_id, + author: data.author, + ...('guild_id' in data && { guild_id: data.guild_id }), + }); if (channel) { if (!channel.isTextBased()) return {}; diff --git a/packages/discord.js/src/client/actions/MessageDelete.js b/packages/discord.js/src/client/actions/MessageDelete.js index 34acb42b3ba4..c67c5abf0ecf 100644 --- a/packages/discord.js/src/client/actions/MessageDelete.js +++ b/packages/discord.js/src/client/actions/MessageDelete.js @@ -6,7 +6,7 @@ const Events = require('../../util/Events'); class MessageDeleteAction extends Action { handle(data) { const client = this.client; - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); let message; if (channel) { if (!channel.isTextBased()) return {}; diff --git a/packages/discord.js/src/client/actions/MessagePollVoteAdd.js b/packages/discord.js/src/client/actions/MessagePollVoteAdd.js index 2a2bdc649ee1..411467ca3d1f 100644 --- a/packages/discord.js/src/client/actions/MessagePollVoteAdd.js +++ b/packages/discord.js/src/client/actions/MessagePollVoteAdd.js @@ -5,7 +5,7 @@ const Events = require('../../util/Events'); class MessagePollVoteAddAction extends Action { handle(data) { - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel?.isTextBased()) return false; const message = this.getMessage(data, channel); diff --git a/packages/discord.js/src/client/actions/MessagePollVoteRemove.js b/packages/discord.js/src/client/actions/MessagePollVoteRemove.js index c3eab3bd6742..afae556a4b94 100644 --- a/packages/discord.js/src/client/actions/MessagePollVoteRemove.js +++ b/packages/discord.js/src/client/actions/MessagePollVoteRemove.js @@ -5,7 +5,7 @@ const Events = require('../../util/Events'); class MessagePollVoteRemoveAction extends Action { handle(data) { - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel?.isTextBased()) return false; const message = this.getMessage(data, channel); diff --git a/packages/discord.js/src/client/actions/MessageReactionAdd.js b/packages/discord.js/src/client/actions/MessageReactionAdd.js index b32f7154f102..de026a82bb73 100644 --- a/packages/discord.js/src/client/actions/MessageReactionAdd.js +++ b/packages/discord.js/src/client/actions/MessageReactionAdd.js @@ -25,7 +25,7 @@ class MessageReactionAdd extends Action { // Verify channel const channel = this.getChannel({ id: data.channel_id, - guild_id: data.guild_id, + ...('guild_id' in data && { guild_id: data.guild_id }), user_id: data.user_id, ...this.spreadInjectedData(data), }); diff --git a/packages/discord.js/src/client/actions/MessageReactionRemove.js b/packages/discord.js/src/client/actions/MessageReactionRemove.js index 5430a37c461e..888f354f110a 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemove.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemove.js @@ -19,7 +19,11 @@ class MessageReactionRemove extends Action { if (!user) return false; // Verify channel - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id, user_id: data.user_id }); + const channel = this.getChannel({ + id: data.channel_id, + ...('guild_id' in data && { guild_id: data.guild_id }), + user_id: data.user_id, + }); if (!channel?.isTextBased()) return false; // Verify message diff --git a/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js b/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js index 5816341732f6..df3d5001cb6c 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js @@ -6,7 +6,7 @@ const Events = require('../../util/Events'); class MessageReactionRemoveAll extends Action { handle(data) { // Verify channel - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel?.isTextBased()) return false; // Verify message diff --git a/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js b/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js index 2916f061d290..4f8706317ee6 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js @@ -5,7 +5,7 @@ const Events = require('../../util/Events'); class MessageReactionRemoveEmoji extends Action { handle(data) { - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel?.isTextBased()) return false; const message = this.getMessage(data, channel); diff --git a/packages/discord.js/src/client/actions/MessageUpdate.js b/packages/discord.js/src/client/actions/MessageUpdate.js index 181c17448c75..4aa4f84def5c 100644 --- a/packages/discord.js/src/client/actions/MessageUpdate.js +++ b/packages/discord.js/src/client/actions/MessageUpdate.js @@ -4,7 +4,7 @@ const Action = require('./Action'); class MessageUpdateAction extends Action { handle(data) { - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (channel) { if (!channel.isTextBased()) return {}; diff --git a/packages/discord.js/src/client/actions/TypingStart.js b/packages/discord.js/src/client/actions/TypingStart.js index 8e217eccc909..637edaa3e960 100644 --- a/packages/discord.js/src/client/actions/TypingStart.js +++ b/packages/discord.js/src/client/actions/TypingStart.js @@ -6,7 +6,7 @@ const Events = require('../../util/Events'); class TypingStart extends Action { handle(data) { - const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id }); + const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel) return; if (!channel.isTextBased()) { From 651f2d036abecafce00bac3c3e8eb15540fafc49 Mon Sep 17 00:00:00 2001 From: Qjuh <76154676+Qjuh@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:49:31 +0200 Subject: [PATCH 38/42] feat: show default values in docs (#10465) --- .../src/generators/ApiModelGenerator.ts | 18 +++++++++++++----- .../scripts/src/generateSplitDocumentation.ts | 6 ++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/api-extractor/src/generators/ApiModelGenerator.ts b/packages/api-extractor/src/generators/ApiModelGenerator.ts index 039a21f28eb0..d4b56ce037ec 100644 --- a/packages/api-extractor/src/generators/ApiModelGenerator.ts +++ b/packages/api-extractor/src/generators/ApiModelGenerator.ts @@ -114,7 +114,7 @@ interface DocgenEventJson { } interface DocgenParamJson { - default?: string; + default?: boolean | number | string; description: string; name: string; nullable?: boolean; @@ -155,7 +155,7 @@ interface DocgenMethodJson { interface DocgenPropertyJson { abstract?: boolean; access?: DocgenAccess; - default?: string; + default?: boolean | number | string; deprecated?: DocgenDeprecated; description: string; meta: DocgenMetaJson; @@ -1264,7 +1264,7 @@ export class ApiModelGenerator { const apiItemMetadata: ApiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration); const docComment: tsdoc.DocComment | undefined = jsDoc ? this._tsDocParser.parseString( - `/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}\n${ + `/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}${jsDoc.default ? ` (default: ${this._escapeSpecialChars(jsDoc.default)})` : ''}\n${ 'see' in jsDoc ? jsDoc.see.map((see) => ` * @see ${see}\n`).join('') : '' }${'readonly' in jsDoc && jsDoc.readonly ? ' * @readonly\n' : ''}${ 'deprecated' in jsDoc && jsDoc.deprecated @@ -1342,7 +1342,7 @@ export class ApiModelGenerator { const apiItemMetadata: ApiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration); const docComment: tsdoc.DocComment | undefined = jsDoc ? this._tsDocParser.parseString( - `/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}\n${ + `/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}${jsDoc.default ? ` (default: ${this._escapeSpecialChars(jsDoc.default)})` : ''}\n${ 'see' in jsDoc ? jsDoc.see.map((see) => ` * @see ${see}\n`).join('') : '' }${'readonly' in jsDoc && jsDoc.readonly ? ' * @readonly\n' : ''}${ 'deprecated' in jsDoc && jsDoc.deprecated @@ -1746,6 +1746,14 @@ export class ApiModelGenerator { return sourceLocation; } + private _escapeSpecialChars(input: boolean | number | string) { + if (typeof input !== 'string') { + return input; + } + + return input.replaceAll(/(?[{}])/g, '\\$'); + } + private _fixLinkTags(input?: string): string | undefined { return input ?.replaceAll(linkRegEx, (_match, _p1, _p2, _p3, _p4, _p5, _offset, _string, groups) => { @@ -1823,7 +1831,7 @@ export class ApiModelGenerator { isOptional: Boolean(prop.nullable), isReadonly: Boolean(prop.readonly), docComment: this._tsDocParser.parseString( - `/**\n * ${this._fixLinkTags(prop.description) ?? ''}\n${ + `/**\n * ${this._fixLinkTags(prop.description) ?? ''}${prop.default ? ` (default: ${this._escapeSpecialChars(prop.default)})` : ''}\n${ prop.see?.map((see) => ` * @see ${see}\n`).join('') ?? '' }${prop.readonly ? ' * @readonly\n' : ''} */`, ).docComment, diff --git a/packages/scripts/src/generateSplitDocumentation.ts b/packages/scripts/src/generateSplitDocumentation.ts index 41019ba8706a..6c523a34ef47 100644 --- a/packages/scripts/src/generateSplitDocumentation.ts +++ b/packages/scripts/src/generateSplitDocumentation.ts @@ -39,6 +39,7 @@ import { } from '@discordjs/api-extractor-model'; import { DocNodeKind, SelectorKind, StandardTags } from '@microsoft/tsdoc'; import type { + DocEscapedText, DocNode, DocNodeContainer, DocDeclarationReference, @@ -307,6 +308,11 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) { kind: DocNodeKind.PlainText, text: (node as DocPlainText).text, }; + case DocNodeKind.EscapedText: + return { + kind: DocNodeKind.PlainText, + text: (node as DocEscapedText).decodedText, + }; case DocNodeKind.Section: case DocNodeKind.Paragraph: return (node as DocNodeContainer).nodes.map((node) => createNode(node)); From 896dc8b21ec038916901ef4fb38e4449b452af5d Mon Sep 17 00:00:00 2001 From: ckohen Date: Sun, 15 Sep 2024 10:58:21 -0700 Subject: [PATCH 39/42] chore: update cliff configs (#10471) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/brokers/cliff.toml | 6 ++++-- packages/builders/cliff.toml | 6 ++++-- packages/collection/cliff.toml | 6 ++++-- packages/core/cliff.toml | 6 ++++-- packages/create-discord-bot/cliff.toml | 6 ++++-- packages/discord.js/cliff.toml | 9 +++++---- packages/formatters/cliff.toml | 6 ++++-- packages/next/cliff.toml | 6 ++++-- packages/proxy/cliff.toml | 6 ++++-- packages/rest/cliff.toml | 6 ++++-- .../turbo/generators/templates/default/cliff.toml | 6 ++++-- packages/ui/cliff.toml | 6 ++++-- packages/util/cliff.toml | 6 ++++-- packages/voice/cliff.toml | 6 ++++-- packages/ws/cliff.toml | 6 ++++-- 15 files changed, 61 insertions(+), 32 deletions(-) diff --git a/packages/brokers/cliff.toml b/packages/brokers/cliff.toml index 35a2901131c2..62d797a75f8c 100644 --- a/packages/brokers/cliff.toml +++ b/packages/brokers/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/builders/cliff.toml b/packages/builders/cliff.toml index 834d7df3f988..192d1843ba14 100644 --- a/packages/builders/cliff.toml +++ b/packages/builders/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/collection/cliff.toml b/packages/collection/cliff.toml index 307c58882011..007cd8392082 100644 --- a/packages/collection/cliff.toml +++ b/packages/collection/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/core/cliff.toml b/packages/core/cliff.toml index e01e42509dd2..ee854b5567dd 100644 --- a/packages/core/cliff.toml +++ b/packages/core/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/create-discord-bot/cliff.toml b/packages/create-discord-bot/cliff.toml index 245edd6c62d6..83efccf45828 100644 --- a/packages/create-discord-bot/cliff.toml +++ b/packages/create-discord-bot/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/discord.js/cliff.toml b/packages/discord.js/cliff.toml index e2a9e82ee5c0..fb83cc52c3ec 100644 --- a/packages/discord.js/cliff.toml +++ b/packages/discord.js/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} @@ -67,8 +69,7 @@ commit_parsers = [ { body = ".*security", group = "Security"}, ] filter_commits = true -tag_pattern = "[0-9]*" -skip_tags = "v[0-9]*|@discordjs*" +tag_pattern = "^[0-9]+" ignore_tags = "" topo_order = false sort_commits = "newest" diff --git a/packages/formatters/cliff.toml b/packages/formatters/cliff.toml index e7c37c63d28d..cb58b2509a1d 100644 --- a/packages/formatters/cliff.toml +++ b/packages/formatters/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/next/cliff.toml b/packages/next/cliff.toml index ce63ba045147..fcc874411301 100644 --- a/packages/next/cliff.toml +++ b/packages/next/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/proxy/cliff.toml b/packages/proxy/cliff.toml index dffb706e3e7a..f09afa82f5eb 100644 --- a/packages/proxy/cliff.toml +++ b/packages/proxy/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/rest/cliff.toml b/packages/rest/cliff.toml index 31962f61267e..642c5a79be8c 100644 --- a/packages/rest/cliff.toml +++ b/packages/rest/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/scripts/turbo/generators/templates/default/cliff.toml b/packages/scripts/turbo/generators/templates/default/cliff.toml index 65a05384048c..09c581a7c723 100644 --- a/packages/scripts/turbo/generators/templates/default/cliff.toml +++ b/packages/scripts/turbo/generators/templates/default/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/ui/cliff.toml b/packages/ui/cliff.toml index 7039aa4a2042..1cc24a080685 100644 --- a/packages/ui/cliff.toml +++ b/packages/ui/cliff.toml @@ -29,8 +29,10 @@ body = """ {% endif %}\ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/util/cliff.toml b/packages/util/cliff.toml index f932465f396b..8cd0e16f6015 100644 --- a/packages/util/cliff.toml +++ b/packages/util/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/voice/cliff.toml b/packages/voice/cliff.toml index cfd0279ee76a..7f8d477f1fda 100644 --- a/packages/voice/cliff.toml +++ b/packages/voice/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} diff --git a/packages/ws/cliff.toml b/packages/ws/cliff.toml index 95f85d41958e..b3fa611dad6a 100644 --- a/packages/ws/cliff.toml +++ b/packages/ws/cliff.toml @@ -30,8 +30,10 @@ body = """ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\ {% if commit.breaking %}\ - {% for breakingChange in commit.footers %}\ - \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% for footer in commit.footers %}\ + {% if footer.breaking %}\ + \n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\ + {% endif %}\ {% endfor %}\ {% endif %}\ {% endfor %} From 99136d6be8bf84a9295854aaaec1caa8d04a9bdf Mon Sep 17 00:00:00 2001 From: Qjuh <76154676+Qjuh@users.noreply.github.com> Date: Sun, 15 Sep 2024 21:27:43 +0200 Subject: [PATCH 40/42] fix(website): nullable parameters on events (#10510) --- .../src/generators/ApiModelGenerator.ts | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/api-extractor/src/generators/ApiModelGenerator.ts b/packages/api-extractor/src/generators/ApiModelGenerator.ts index d4b56ce037ec..c55268815004 100644 --- a/packages/api-extractor/src/generators/ApiModelGenerator.ts +++ b/packages/api-extractor/src/generators/ApiModelGenerator.ts @@ -1510,15 +1510,17 @@ export class ApiModelGenerator { const excerptTokens: IExcerptToken[] = [ { kind: ExcerptTokenKind.Content, - text: `on('${name}', (${ - jsDoc.params?.length ? `${jsDoc.params[0]?.name}${jsDoc.params[0]?.nullable ? '?' : ''}: ` : ') => {})' + text: `public on(eventName: '${name}', listener: (${ + jsDoc.params?.length + ? `${jsDoc.params[0]?.name}${jsDoc.params[0]?.optional ? '?' : ''}: ` + : ') => void): this;' }`, }, ]; const parameters: IApiParameterOptions[] = []; for (let index = 0; index < (jsDoc.params?.length ?? 0) - 1; index++) { const parameter = jsDoc.params![index]!; - const newTokens = this._mapVarType(parameter.type); + const newTokens = this._mapVarType(parameter.type, parameter.nullable); parameters.push({ parameterName: parameter.name, parameterTypeTokenRange: { @@ -1537,7 +1539,7 @@ export class ApiModelGenerator { if (jsDoc.params?.length) { const parameter = jsDoc.params![jsDoc.params.length - 1]!; - const newTokens = this._mapVarType(parameter.type); + const newTokens = this._mapVarType(parameter.type, parameter.nullable); parameters.push({ parameterName: parameter.name, parameterTypeTokenRange: { @@ -1550,7 +1552,7 @@ export class ApiModelGenerator { excerptTokens.push(...newTokens); excerptTokens.push({ kind: ExcerptTokenKind.Content, - text: `) => {})`, + text: `) => void): this;`, }); } @@ -1773,7 +1775,7 @@ export class ApiModelGenerator { .replaceAll('* ', '\n * * '); } - private _mapVarType(typey: DocgenVarTypeJson): IExcerptToken[] { + private _mapVarType(typey: DocgenVarTypeJson, nullable?: boolean): IExcerptToken[] { const mapper = Array.isArray(typey) ? typey : (typey.types ?? []); const lookup: { [K in ts.SyntaxKind]?: string } = { [ts.SyntaxKind.ClassDeclaration]: 'class', @@ -1816,7 +1818,22 @@ export class ApiModelGenerator { { kind: ExcerptTokenKind.Content, text: symbol ?? '' }, ]; }, []); - return index === 0 ? result : [{ kind: ExcerptTokenKind.Content, text: ' | ' }, ...result]; + return index === 0 + ? mapper.length === 1 && (nullable || ('nullable' in typey && typey.nullable)) + ? [ + ...result, + { kind: ExcerptTokenKind.Content, text: ' | ' }, + { kind: ExcerptTokenKind.Reference, text: 'null' }, + ] + : result + : index === mapper.length - 1 && (nullable || ('nullable' in typey && typey.nullable)) + ? [ + { kind: ExcerptTokenKind.Content, text: ' | ' }, + ...result, + { kind: ExcerptTokenKind.Content, text: ' | ' }, + { kind: ExcerptTokenKind.Reference, text: 'null' }, + ] + : [{ kind: ExcerptTokenKind.Content, text: ' | ' }, ...result]; }) .filter((excerpt) => excerpt.text.length); } From 665bf1486aec62e9528f5f7b5a6910ae6b5a6c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=86MB=C3=98?= <69138346+TAEMBO@users.noreply.github.com> Date: Tue, 17 Sep 2024 01:18:08 -0700 Subject: [PATCH 41/42] types(MessageEditOptions): Omit `poll` (#10509) fix: creating poll from message edit Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- packages/discord.js/src/structures/Webhook.js | 2 +- .../structures/interfaces/InteractionResponses.js | 2 +- .../src/structures/interfaces/TextBasedChannel.js | 7 ++++++- packages/discord.js/typings/index.d.ts | 13 +++++++++---- packages/discord.js/typings/index.test-d.ts | 10 ++++++++++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/discord.js/src/structures/Webhook.js b/packages/discord.js/src/structures/Webhook.js index 9b2bad0d5467..e52ec14040ae 100644 --- a/packages/discord.js/src/structures/Webhook.js +++ b/packages/discord.js/src/structures/Webhook.js @@ -126,7 +126,7 @@ class Webhook { /** * Options that can be passed into send. - * @typedef {BaseMessageOptions} WebhookMessageCreateOptions + * @typedef {BaseMessageOptionsWithPoll} WebhookMessageCreateOptions * @property {boolean} [tts=false] Whether the message should be spoken aloud * @property {MessageFlags} [flags] Which flags to set for the message. * Only the {@link MessageFlags.SuppressEmbeds} flag can be set. diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 9f711b517b49..440242a34e56 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -36,7 +36,7 @@ class InteractionResponses { /** * Options for a reply to a {@link BaseInteraction}. - * @typedef {BaseMessageOptions} InteractionReplyOptions + * @typedef {BaseMessageOptionsWithPoll} InteractionReplyOptions * @property {boolean} [tts=false] Whether the message should be spoken aloud * @property {boolean} [ephemeral] Whether the reply should be ephemeral * @property {boolean} [fetchReply] Whether to fetch the reply diff --git a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js index c3f5a9e6c573..d2e408580253 100644 --- a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js +++ b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js @@ -80,6 +80,11 @@ class TextBasedChannel { * The files to send with the message. * @property {Array<(ActionRowBuilder|ActionRow|APIActionRowComponent)>} [components] * Action rows containing interactive components for the message (buttons, select menus) + */ + + /** + * The base message options for messages including a poll. + * @typedef {BaseMessageOptions} BaseMessageOptionsWithPoll * @property {PollData} [poll] The poll to send with the message */ @@ -93,7 +98,7 @@ class TextBasedChannel { /** * The options for sending a message. - * @typedef {BaseMessageOptions} BaseMessageCreateOptions + * @typedef {BaseMessageOptionsWithPoll} BaseMessageCreateOptions * @property {boolean} [tts=false] Whether the message should be spoken aloud * @property {string} [nonce] The nonce for the message * This property is required if `enforceNonce` set to `true`. diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 2ac27e78a990..771623c5cff5 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -6291,7 +6291,7 @@ export interface InteractionDeferReplyOptions { export interface InteractionDeferUpdateOptions extends Omit {} -export interface InteractionReplyOptions extends BaseMessageOptions { +export interface InteractionReplyOptions extends BaseMessageOptionsWithPoll { tts?: boolean; ephemeral?: boolean; fetchReply?: boolean; @@ -6459,10 +6459,13 @@ export interface BaseMessageOptions { | ActionRowData | APIActionRowComponent )[]; +} + +export interface BaseMessageOptionsWithPoll extends BaseMessageOptions { poll?: PollData; } -export interface MessageCreateOptions extends BaseMessageOptions { +export interface MessageCreateOptions extends BaseMessageOptionsWithPoll { tts?: boolean; nonce?: string | number; enforceNonce?: boolean; @@ -6475,7 +6478,7 @@ export interface MessageCreateOptions extends BaseMessageOptions { } export interface GuildForumThreadMessageCreateOptions - extends Omit, + extends BaseMessageOptions, Pick {} export interface MessageEditAttachmentData { @@ -6981,7 +6984,9 @@ export interface WebhookMessageEditOptions extends Omit { message?: MessageResolvable | '@original'; } diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 1f499be832d6..f23023f1acca 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -210,6 +210,7 @@ import { ApplicationEmojiManager, StickerPack, SendableChannels, + PollData, } from '.'; import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd'; import type { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders'; @@ -2576,6 +2577,8 @@ await textChannel.send({ }); declare const poll: Poll; +declare const message: Message; +declare const pollData: PollData; { expectType(await poll.end()); @@ -2589,6 +2592,13 @@ declare const poll: Poll; messageId: snowflake, answerId: 1, }); + + await message.edit({ + // @ts-expect-error + poll: pollData, + }); + + await chatInputInteraction.editReply({ poll: pollData }); } expectType>(await client.fetchStickerPacks()); From cda8d88ad5be01e6bcec0d36c0ef56fe9ce48e64 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Tue, 17 Sep 2024 11:15:00 +0200 Subject: [PATCH 42/42] build: bump discord-api-types to 0.37.100 (#10488) * build: bump discord-api-types to 0.37.100 * build: fix lockfile --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- packages/builders/package.json | 2 +- packages/core/package.json | 2 +- packages/discord.js/package.json | 2 +- packages/formatters/package.json | 2 +- packages/next/package.json | 2 +- packages/rest/package.json | 2 +- packages/voice/package.json | 2 +- packages/ws/package.json | 2 +- pnpm-lock.yaml | 39 ++++++++++++++++++-------------- 9 files changed, 30 insertions(+), 25 deletions(-) diff --git a/packages/builders/package.json b/packages/builders/package.json index 9e5d39f20122..ebc3263a889f 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -68,7 +68,7 @@ "@discordjs/formatters": "workspace:^", "@discordjs/util": "workspace:^", "@sapphire/shapeshift": "^4.0.0", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.4", "tslib": "^2.6.3" diff --git a/packages/core/package.json b/packages/core/package.json index 5a4e8449b711..d1356c00b0ac 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,7 +70,7 @@ "@discordjs/ws": "workspace:^", "@sapphire/snowflake": "^3.5.3", "@vladfrangu/async_event_emitter": "^2.4.6", - "discord-api-types": "0.37.97" + "discord-api-types": "0.37.100" }, "devDependencies": { "@discordjs/api-extractor": "workspace:^", diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index a9dc7fd671ba..699547837525 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -72,7 +72,7 @@ "@discordjs/util": "workspace:^", "@discordjs/ws": "1.1.1", "@sapphire/snowflake": "3.5.3", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "fast-deep-equal": "3.1.3", "lodash.snakecase": "4.1.1", "tslib": "^2.6.3", diff --git a/packages/formatters/package.json b/packages/formatters/package.json index ae0ee90b051e..dbd063df78fc 100644 --- a/packages/formatters/package.json +++ b/packages/formatters/package.json @@ -55,7 +55,7 @@ "homepage": "https://discord.js.org", "funding": "https://github.com/discordjs/discord.js?sponsor", "dependencies": { - "discord-api-types": "0.37.97" + "discord-api-types": "0.37.100" }, "devDependencies": { "@discordjs/api-extractor": "workspace:^", diff --git a/packages/next/package.json b/packages/next/package.json index a16e321e6ddb..513c02949be2 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -72,7 +72,7 @@ "@discordjs/rest": "workspace:^", "@discordjs/util": "workspace:^", "@discordjs/ws": "workspace:^", - "discord-api-types": "0.37.97" + "discord-api-types": "0.37.100" }, "devDependencies": { "@discordjs/api-extractor": "workspace:^", diff --git a/packages/rest/package.json b/packages/rest/package.json index 0eec7df15376..eb2e8ae5f481 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -88,7 +88,7 @@ "@sapphire/async-queue": "^1.5.3", "@sapphire/snowflake": "^3.5.3", "@vladfrangu/async_event_emitter": "^2.4.6", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "magic-bytes.js": "^1.10.0", "tslib": "^2.6.3", "undici": "6.19.8" diff --git a/packages/voice/package.json b/packages/voice/package.json index cefe7ffbbf2e..5c11a768cfe7 100644 --- a/packages/voice/package.json +++ b/packages/voice/package.json @@ -64,7 +64,7 @@ "funding": "https://github.com/discordjs/discord.js?sponsor", "dependencies": { "@types/ws": "^8.5.12", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "prism-media": "^1.3.5", "tslib": "^2.6.3", "ws": "^8.18.0" diff --git a/packages/ws/package.json b/packages/ws/package.json index 0957e203c1e9..4f669a5a49d6 100644 --- a/packages/ws/package.json +++ b/packages/ws/package.json @@ -79,7 +79,7 @@ "@sapphire/async-queue": "^1.5.3", "@types/ws": "^8.5.12", "@vladfrangu/async_event_emitter": "^2.4.6", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "tslib": "^2.6.3", "ws": "^8.18.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d809a09d8581..4b67fad1ec60 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -680,8 +680,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 fast-deep-equal: specifier: ^3.1.3 version: 3.1.3 @@ -804,8 +804,8 @@ importers: specifier: ^2.4.6 version: 2.4.6 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 devDependencies: '@discordjs/api-extractor': specifier: workspace:^ @@ -941,8 +941,8 @@ importers: specifier: 3.5.3 version: 3.5.3 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 fast-deep-equal: specifier: 3.1.3 version: 3.1.3 @@ -1060,8 +1060,8 @@ importers: packages/formatters: dependencies: discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 devDependencies: '@discordjs/api-extractor': specifier: workspace:^ @@ -1133,8 +1133,8 @@ importers: specifier: workspace:^ version: link:../ws discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 devDependencies: '@discordjs/api-extractor': specifier: workspace:^ @@ -1307,8 +1307,8 @@ importers: specifier: ^2.4.6 version: 2.4.6 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 magic-bytes.js: specifier: ^1.10.0 version: 1.10.0 @@ -1604,8 +1604,8 @@ importers: specifier: ^8.5.12 version: 8.5.12 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 prism-media: specifier: ^1.3.5 version: 1.3.5 @@ -1701,8 +1701,8 @@ importers: specifier: ^2.4.6 version: 2.4.6 discord-api-types: - specifier: 0.37.97 - version: 0.37.97 + specifier: 0.37.100 + version: 0.37.100 tslib: specifier: ^2.6.3 version: 2.6.3 @@ -7632,6 +7632,9 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} + discord-api-types@0.37.100: + resolution: {integrity: sha512-a8zvUI0GYYwDtScfRd/TtaNBDTXwP5DiDVX7K5OmE+DRT57gBqKnwtOC5Ol8z0mRW8KQfETIgiB8U0YZ9NXiCA==} + discord-api-types@0.37.83: resolution: {integrity: sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==} @@ -19154,7 +19157,7 @@ snapshots: '@types/ws@8.5.12': dependencies: - '@types/node': 16.18.105 + '@types/node': 18.19.45 '@types/yargs-parser@21.0.3': {} @@ -21483,6 +21486,8 @@ snapshots: dependencies: path-type: 4.0.0 + discord-api-types@0.37.100: {} + discord-api-types@0.37.83: {} discord-api-types@0.37.97: {}