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.
This commit is contained in:
Jiralite
2024-12-13 18:21:10 +00:00
committed by GitHub
parent 0848fc6b4e
commit 35ebcc7d5a
3 changed files with 0 additions and 74 deletions

View File

@@ -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<RESTPostAPIGuildStickerFormDataBody, 'file'> {
file: RawFile;
@@ -682,25 +679,6 @@ export class GuildsAPI {
}) as Promise<RESTPatchAPIGuildWelcomeScreenResult>;
}
/**
* 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<RequestData, 'reason' | 'signal'> = {},
) {
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<RESTGetAPIGuildWebhooksResult>;
}
/**
* 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<RequestData, 'signal'> = {},
) {
return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
}
/**
* Fetches a guild onboarding
*

View File

@@ -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<RequestData, 'signal'> = {},
) {
await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), {
auth: false,
body: {
type: InteractionResponseType.PremiumRequired,
} satisfies APIPremiumRequiredInteractionResponse,
signal,
});
}
}

View File

@@ -33,17 +33,6 @@ export class StickersAPI {
return this.rest.get(Routes.stickerPacks(), { signal }) as Promise<RESTGetStickerPacksResult>;
}
/**
* 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<RequestData, 'signal'> = {}) {
return this.getStickers(options);
}
/**
* Fetches a sticker
*