diff --git a/packages/discord.js/src/managers/ApplicationCommandManager.js b/packages/discord.js/src/managers/ApplicationCommandManager.js index 8f6ce5310..6f23bbe2d 100644 --- a/packages/discord.js/src/managers/ApplicationCommandManager.js +++ b/packages/discord.js/src/managers/ApplicationCommandManager.js @@ -258,7 +258,6 @@ class ApplicationCommandManager extends CachedManager { type: command.type, 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/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js index 37eff9e46..eef940d57 100644 --- a/packages/discord.js/src/structures/ApplicationCommand.js +++ b/packages/discord.js/src/structures/ApplicationCommand.js @@ -140,18 +140,6 @@ class ApplicationCommand extends Base { this.defaultMemberPermissions ??= null; } - if ('dm_permission' in data) { - /** - * 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 @@ -224,7 +212,6 @@ class ApplicationCommand extends Base { * @property {ApplicationCommandOptionData[]} [options] Options for the command * @property {?PermissionResolvable} [defaultMemberPermissions] The bitfield used to determine the default permissions * a member needs in order to run the command - * @property {boolean} [dmPermission] Whether the command is enabled in DMs */ /** @@ -341,15 +328,6 @@ class ApplicationCommand extends Base { return this.edit({ defaultMemberPermissions }); } - /** - * Edits the DM permission of this ApplicationCommand - * @param {boolean} [dmPermission=true] Whether the command can be used in DMs - * @returns {Promise} - */ - setDMPermission(dmPermission = true) { - return this.edit({ dmPermission }); - } - /** * Edits the options of this ApplicationCommand * @param {ApplicationCommandOptionData[]} options The options to set for this command @@ -386,7 +364,6 @@ class ApplicationCommand extends Base { if (command.id && this.id !== command.id) return false; let defaultMemberPermissions = null; - let dmPermission = command.dmPermission ?? command.dm_permission; if ('default_member_permissions' in command) { defaultMemberPermissions = command.default_member_permissions @@ -412,7 +389,6 @@ class ApplicationCommand extends Base { // TODO: remove ?? 0 on each when nullable (command.options?.length ?? 0) !== (this.options?.length ?? 0) || defaultMemberPermissions !== (this.defaultMemberPermissions?.bitfield ?? null) || - (dmPermission !== undefined && dmPermission !== this.dmPermission) || !isEqual(command.nameLocalizations ?? command.name_localizations ?? {}, this.nameLocalizations ?? {}) || !isEqual( command.descriptionLocalizations ?? command.description_localizations ?? {}, diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 8bf1222c1..f052113e2 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -413,33 +413,6 @@ class Message extends Base { this.interactionMetadata ??= null; } - /** - * Partial data of the interaction that a message is a reply to - * @typedef {Object} MessageInteraction - * @property {Snowflake} id The interaction's id - * @property {InteractionType} type The type of the interaction - * @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) { - /** - * 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, - type: data.interaction.type, - commandName: data.interaction.name, - user: this.client.users._add(data.interaction.user), - }; - } else { - this.interaction ??= null; - } - if (data.poll) { /** * The poll that was sent with the message diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index ac7242ab0..36aba253d 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -429,8 +429,6 @@ export class ApplicationCommand extends Base { 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; @@ -460,7 +458,6 @@ export class ApplicationCommand extends Base { public setDefaultMemberPermissions( defaultMemberPermissions: PermissionResolvable | null, ): Promise>; - public setDMPermission(dmPermission?: boolean): Promise>; public setOptions( options: readonly ApplicationCommandOptionData[], ): Promise>; @@ -2207,8 +2204,6 @@ 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; @@ -4694,7 +4689,6 @@ export type AllowedThreadTypeForTextChannel = ChannelType.PublicThread | Channel export interface BaseApplicationCommandData { name: string; nameLocalizations?: LocalizationMap; - dmPermission?: boolean; defaultMemberPermissions?: PermissionResolvable | null; nsfw?: boolean; contexts?: readonly InteractionContextType[]; @@ -6338,14 +6332,6 @@ export interface MessageInteractionMetadata { triggeringInteractionMetadata: MessageInteractionMetadata | null; } -/** @deprecated Use {@link MessageInteractionMetadata} instead. */ -export interface MessageInteraction { - id: Snowflake; - type: InteractionType; - commandName: string; - user: User; -} - export interface MessageMentionsHasOptions { ignoreDirect?: boolean; ignoreRoles?: boolean; diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 036d7250d..266205746 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -705,7 +705,6 @@ client.on('clientReady', async client => { await client.application?.commands.edit(globalCommandId, { defaultMemberPermissions: null }); await globalCommand?.edit({ defaultMemberPermissions: null }); await globalCommand?.setDefaultMemberPermissions(null); - await guildCommandFromGlobal?.edit({ dmPermission: false }); // @ts-expect-error await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId, { guildId: testGuildId });