Files
discord.js/packages/core/src/api/sticker.ts
Suneet Tipirneni 6d5840c61e fix(core): fix inconsistencies on core (#9680)
* fix(core): fix inconsistencies on `core`

* fix: add `createForumPost` back

* fix: create -> createWebhook
2023-07-06 13:35:10 +00:00

35 lines
1.1 KiB
TypeScript

/* eslint-disable jsdoc/check-param-names */
import type { RequestData, REST } from '@discordjs/rest';
import {
Routes,
type RESTGetAPIStickerResult,
type RESTGetNitroStickerPacksResult,
type Snowflake,
} from 'discord-api-types/v10';
export class StickersAPI {
public constructor(private readonly rest: REST) {}
/**
* Fetches all of the nitro sticker packs
*
* @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
* @param options - The options for fetching the sticker packs
*/
public async getNitroStickers({ signal }: Pick<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.nitroStickerPacks(), { signal }) as Promise<RESTGetNitroStickerPacksResult>;
}
/**
* Fetches a sticker
*
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
* @param stickerId - The id of the sticker
* @param options - The options for fetching the sticker
*/
public async get(stickerId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.sticker(stickerId), { signal }) as Promise<RESTGetAPIStickerResult>;
}
}