Skip to content

Commit

Permalink
feat: getNitroStickerPacks() -> getStickerPacks() (#109)
Browse files Browse the repository at this point in the history
* feat: getNitroStickerPacks() -> getStickerPacks()

Sticker packs that used to be Nitro-only are free now - this slipped under the radar.

Ref: discord/discord-api-docs#6265

* fix typos

* reword the deprecation message along with reasoning
  • Loading branch information
TTtie committed Jan 9, 2024
1 parent 076a126 commit e366d6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2919,6 +2919,7 @@ declare namespace Dysnomia {
getRoleConnectionMetadata(): Promise<ApplicationRoleConnectionMetadata[]>;
getSelf(): Promise<ExtendedUser>;
getStageInstance(channelID: string): Promise<StageInstance>;
getStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>;
getThreadMember(channelID: string, memberID: string, options: GetThreadMemberOptions): Promise<ThreadMember>;
getThreadMembers(channelID: string, options: GetThreadMembersOptions): Promise<ThreadMember[]>;
getVoiceRegions(guildID?: string): Promise<VoiceRegion[]>;
Expand Down
12 changes: 10 additions & 2 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2687,10 +2687,10 @@ class Client extends EventEmitter {

/**
* Get the list of sticker packs available to Nitro subscribers
* @returns {Promise<Object>} An object whichs contains a value which contains an array of sticker packs
* @returns {Promise<Object>} An object which contains a value which contains an array of sticker packs
*/
getNitroStickerPacks() {
return this.requestHandler.request("GET", Endpoints.STICKER_PACKS, true);
return this.getStickerPacks();
}

/**
Expand Down Expand Up @@ -2944,6 +2944,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<Object>} 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
Expand Down

0 comments on commit e366d6a

Please sign in to comment.