From 35ebcc7d5ab834ee7d327365ac9d8ed19140da31 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:21:10 +0000 Subject: [PATCH] refactor!: Remove deprecations (#10645) BREAKING CHANGE: `GuildsAPI#editUserVoiceState()` has been removed. Use `VoiceAPI#editUserVoiceState()` instead. BREAKING CHANGE: `GuildsAPI#setUserVoiceState()` has been removed. Use `VoiceAPI#setUserVoiceState()` instead. BREAKING CHANGE: `InteractionsAPI#sendPremiumRequired()` has been removed. BREAKING CHANGE: `StickersAPI#getNitroStickers()` has been removed. Use `StickersAPI#getStickers()` instead. --- packages/core/src/api/guild.ts | 39 --------------------------- packages/core/src/api/interactions.ts | 24 ----------------- packages/core/src/api/sticker.ts | 11 -------- 3 files changed, 74 deletions(-) diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 41676f9f3..7dcb9af22 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -67,8 +67,6 @@ import { type RESTPatchAPIGuildStickerResult, type RESTPatchAPIGuildTemplateJSONBody, type RESTPatchAPIGuildTemplateResult, - type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, - type RESTPatchAPIGuildVoiceStateUserJSONBody, type RESTPatchAPIGuildWelcomeScreenJSONBody, type RESTPatchAPIGuildWelcomeScreenResult, type RESTPatchAPIGuildWidgetSettingsJSONBody, @@ -108,7 +106,6 @@ import { type RESTPostAPIGuildSoundboardSoundResult, type Snowflake, } from 'discord-api-types/v10'; -import { VoiceAPI } from './voice'; export interface CreateStickerOptions extends Omit { file: RawFile; @@ -682,25 +679,6 @@ export class GuildsAPI { }) as Promise; } - /** - * Edits a user's voice state in a guild - * - * @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state} - * @param guildId - The id of the guild to edit the current user's voice state in - * @param userId - The id of the user to edit the voice state for - * @param body - The data for editing the voice state - * @param options - The options for editing the voice state - * @deprecated Use {@link VoiceAPI.editUserVoiceState} instead - */ - public async editUserVoiceState( - guildId: Snowflake, - userId: Snowflake, - body: RESTPatchAPIGuildVoiceStateUserJSONBody, - { reason, signal }: Pick = {}, - ) { - return new VoiceAPI(this.rest).editUserVoiceState(guildId, userId, body, { reason, signal }); - } - /** * Fetches all emojis for a guild * @@ -1294,23 +1272,6 @@ export class GuildsAPI { return this.rest.get(Routes.guildWebhooks(id)) as Promise; } - /** - * Sets the voice state for the current user - * - * @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state} - * @param guildId - The id of the guild - * @param body - The data for setting the voice state - * @param options - The options for setting the voice state - * @deprecated Use {@link VoiceAPI.editVoiceState} instead - */ - public async setVoiceState( - guildId: Snowflake, - body: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = {}, - { signal }: Pick = {}, - ) { - return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal }); - } - /** * Fetches a guild onboarding * diff --git a/packages/core/src/api/interactions.ts b/packages/core/src/api/interactions.ts index 2b680dd10..053ffd849 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -8,7 +8,6 @@ import { type APIInteractionResponseCallbackData, type APIInteractionResponseDeferredChannelMessageWithSource, type APIModalInteractionResponseCallbackData, - type APIPremiumRequiredInteractionResponse, type RESTGetAPIWebhookWithTokenMessageResult, type RESTPostAPIInteractionCallbackQuery, type RESTPostAPIInteractionCallbackWithResponseResult, @@ -430,27 +429,4 @@ export class InteractionsAPI { return with_response ? response : undefined; } - - /** - * Sends a premium required response to an interaction - * - * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} - * @param interactionId - The id of the interaction - * @param interactionToken - The token of the interaction - * @param options - The options for sending the premium required response - * @deprecated Sending a premium-style button is the new Discord behavior. - */ - public async sendPremiumRequired( - interactionId: Snowflake, - interactionToken: string, - { signal }: Pick = {}, - ) { - await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { - auth: false, - body: { - type: InteractionResponseType.PremiumRequired, - } satisfies APIPremiumRequiredInteractionResponse, - signal, - }); - } } diff --git a/packages/core/src/api/sticker.ts b/packages/core/src/api/sticker.ts index 22ecf0963..57dbbb317 100644 --- a/packages/core/src/api/sticker.ts +++ b/packages/core/src/api/sticker.ts @@ -33,17 +33,6 @@ export class StickersAPI { return this.rest.get(Routes.stickerPacks(), { signal }) as Promise; } - /** - * Fetches all of the sticker packs - * - * @see {@link https://discord.com/developers/docs/resources/sticker#list-sticker-packs} - * @param options - The options for fetching the sticker packs - * @deprecated Use {@link StickersAPI.getStickers} instead. - */ - public async getNitroStickers(options: Pick = {}) { - return this.getStickers(options); - } - /** * Fetches a sticker *