diff --git a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js b/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js deleted file mode 100644 index 17af7d58e2f2..000000000000 --- a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id ? client.guilds.cache.get(data.guild_id)?.commands : client.application.commands; - if (!commandManager) return; - - const command = commandManager._add(data, data.application_id === client.application.id); - - /** - * Emitted when a guild application command is created. - * @event Client#applicationCommandCreate - * @param {ApplicationCommand} command The command which was created - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_CREATE, command); -}; diff --git a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js b/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js deleted file mode 100644 index 4b09274ddb9f..000000000000 --- a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id ? client.guilds.cache.get(data.guild_id)?.commands : client.application.commands; - if (!commandManager) return; - - const isOwn = data.application_id === client.application.id; - const command = commandManager._add(data, isOwn); - if (isOwn) commandManager.cache.delete(data.id); - - /** - * Emitted when a guild application command is deleted. - * @event Client#applicationCommandDelete - * @param {ApplicationCommand} command The command which was deleted - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_DELETE, command); -}; diff --git a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js deleted file mode 100644 index 730d7f1e3a36..000000000000 --- a/packages/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const { Events } = require('../../../util/Constants'); - -module.exports = (client, { d: data }) => { - const commandManager = data.guild_id ? client.guilds.cache.get(data.guild_id)?.commands : client.application.commands; - if (!commandManager) return; - - const oldCommand = commandManager.cache.get(data.id)?._clone() ?? null; - const newCommand = commandManager._add(data, data.application_id === client.application.id); - - /** - * Emitted when a guild application command is updated. - * @event Client#applicationCommandUpdate - * @param {?ApplicationCommand} oldCommand The command before the update - * @param {ApplicationCommand} newCommand The command after the update - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - client.emit(Events.APPLICATION_COMMAND_UPDATE, oldCommand, newCommand); -}; diff --git a/packages/discord.js/src/util/Constants.js b/packages/discord.js/src/util/Constants.js index 0431cebc024e..0dcf301803e8 100644 --- a/packages/discord.js/src/util/Constants.js +++ b/packages/discord.js/src/util/Constants.js @@ -130,18 +130,6 @@ exports.Events = { API_RESPONSE: 'apiResponse', API_REQUEST: 'apiRequest', CLIENT_READY: 'ready', - /** - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - APPLICATION_COMMAND_CREATE: 'applicationCommandCreate', - /** - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - APPLICATION_COMMAND_DELETE: 'applicationCommandDelete', - /** - * @deprecated See {@link https://github.com/discord/discord-api-docs/issues/3690 this issue} for more information. - */ - APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate', GUILD_CREATE: 'guildCreate', GUILD_DELETE: 'guildDelete', GUILD_UPDATE: 'guildUpdate', @@ -238,9 +226,6 @@ exports.PartialTypes = keyMirror(['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', * The type of a WebSocket message event, e.g. `MESSAGE_CREATE`. Here are the available events: * * READY * * RESUMED - * * APPLICATION_COMMAND_CREATE (deprecated) - * * APPLICATION_COMMAND_DELETE (deprecated) - * * APPLICATION_COMMAND_UPDATE (deprecated) * * GUILD_CREATE * * GUILD_DELETE * * GUILD_UPDATE @@ -297,9 +282,6 @@ exports.PartialTypes = keyMirror(['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', exports.WSEvents = keyMirror([ 'READY', 'RESUMED', - 'APPLICATION_COMMAND_CREATE', - 'APPLICATION_COMMAND_DELETE', - 'APPLICATION_COMMAND_UPDATE', 'GUILD_CREATE', 'GUILD_DELETE', 'GUILD_UPDATE', diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 2ba9a42ce624..4ba74fe42392 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -3889,12 +3889,6 @@ export interface BaseClientEvents { } export interface ClientEvents extends BaseClientEvents { - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandCreate: [command: ApplicationCommand]; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandDelete: [command: ApplicationCommand]; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - applicationCommandUpdate: [oldCommand: ApplicationCommand | null, newCommand: ApplicationCommand]; cacheSweep: [message: string]; channelCreate: [channel: NonThreadGuildBasedChannel]; channelDelete: [channel: DMChannel | NonThreadGuildBasedChannel]; @@ -4147,12 +4141,6 @@ export interface ConstantsEvents { API_RESPONSE: 'apiResponse'; API_REQUEST: 'apiRequest'; CLIENT_READY: 'ready'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_CREATE: 'applicationCommandCreate'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_DELETE: 'applicationCommandDelete'; - /** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */ - APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate'; GUILD_CREATE: 'guildCreate'; GUILD_DELETE: 'guildDelete'; GUILD_UPDATE: 'guildUpdate'; @@ -5716,9 +5704,6 @@ export interface WelcomeScreenEditData { export type WSEventType = | 'READY' | 'RESUMED' - | 'APPLICATION_COMMAND_CREATE' - | 'APPLICATION_COMMAND_DELETE' - | 'APPLICATION_COMMAND_UPDATE' | 'GUILD_CREATE' | 'GUILD_DELETE' | 'GUILD_UPDATE'