diff --git a/index.d.ts b/index.d.ts index 28c447de..24f93ec2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2718,6 +2718,7 @@ declare namespace Dysnomia { getMessage(channelID: string, messageID: string): Promise; getMessageReaction(channelID: string, messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; getMessages(channelID: string, options?: GetMessagesOptions): Promise; + /** @deprecated */ getNitroStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>; getOAuthApplication(): Promise; getPins(channelID: string): Promise; @@ -2739,6 +2740,7 @@ declare namespace Dysnomia { getRoleConnectionMetadata(): Promise; getSelf(): Promise; getStageInstance(channelID: string): Promise; + getStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>; getThreadMember(channelID: string, memberID: string, options: GetThreadMemberOptions): Promise; getThreadMembers(channelID: string, options: GetThreadMembersOptions): Promise; getVoiceRegions(guildID?: string): Promise; diff --git a/lib/Client.js b/lib/Client.js index dc62be30..fd770953 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -27,6 +27,7 @@ const UnavailableGuild = require("./structures/UnavailableGuild"); const User = require("./structures/User"); const VoiceConnectionManager = require("./voice/VoiceConnectionManager"); const AutoModerationRule = require("./structures/AutoModerationRule"); +const emitDeprecation = require("./util/emitDeprecation"); let EventEmitter; try { @@ -2489,11 +2490,12 @@ class Client extends EventEmitter { } /** - * Get the list of sticker packs available to Nitro subscribers - * @returns {Promise} An object whichs contains a value which contains an array of sticker packs + * [DEPRECATED] Get the list of sticker packs available to Nitro subscribers + * @returns {Promise} An object which contains a value which contains an array of sticker packs */ getNitroStickerPacks() { - return this.requestHandler.request("GET", Endpoints.STICKER_PACKS, true); + emitDeprecation("NITRO_STICKER_PACKS"); + return this.getStickerPacks(); } /** @@ -2747,6 +2749,14 @@ class Client extends EventEmitter { return this.requestHandler.request("GET", Endpoints.STAGE_INSTANCE(channelID), true).then((instance) => new StageInstance(instance, this)); } + /** + * Get the list of available sticker packs + * @returns {Promise} An object which contains a value which contains an array of sticker packs + */ + getStickerPacks() { + return this.requestHandler.request("GET", Endpoints.STICKER_PACKS, true); + } + /** * Gets a thread member object for a specified user * @arg {String} channelID The ID of the thread channel diff --git a/lib/util/emitDeprecation.js b/lib/util/emitDeprecation.js index ebb84617..9bfb714c 100644 --- a/lib/util/emitDeprecation.js +++ b/lib/util/emitDeprecation.js @@ -1,4 +1,5 @@ const warningMessages = { + NITRO_STICKER_PACKS: "Client#getNitroStickerPacks is deprecated as built-in sticker packs are free for everyone. Please use Client#getStickerPacks instead." }; const unknownCodeMessage = "You have triggered a deprecated behavior whose warning was implemented improperly. Please report this issue.";