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:
Almeida
2024-08-20 11:13:26 +01:00
committed by GitHub
parent 1f7d1f8094
commit 1b1ae2f0cb
5 changed files with 45 additions and 5 deletions

View File

@@ -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
*