mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: use get sticker pack endpoint (#10445)
* feat: use get sticker pack endpoint * fix: mark fetchPack as async * style: resolve eslint warning --------- Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import type { RequestData, REST } from '@discordjs/rest';
|
||||
import {
|
||||
Routes,
|
||||
type RESTGetAPIStickerPack,
|
||||
type RESTGetAPIStickerResult,
|
||||
type RESTGetStickerPacksResult,
|
||||
type Snowflake,
|
||||
@@ -11,6 +12,17 @@ import {
|
||||
export class StickersAPI {
|
||||
public constructor(private readonly rest: REST) {}
|
||||
|
||||
/**
|
||||
* Fetches a sticker pack
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker-pack}
|
||||
* @param packId - The id of the sticker pack
|
||||
* @param options - The options for fetching the sticker pack
|
||||
*/
|
||||
public async getStickerPack(packId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) {
|
||||
return this.rest.get(Routes.stickerPack(packId), { signal }) as Promise<RESTGetAPIStickerPack>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches all of the sticker packs
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user