mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
* helpers: add stickers helpers * deno fmt * undo move getNitroStickerPack to stickers * helpers/stickers: fix jsdocs * plugins/permissions: check stickers permissions * plugins/validations: validate stickers stuff * tests: stickers unit tests * helpers/stickers: add support for reason * plugins/permissions: MANAGE_EMOJIS -> MANAGE_EMOJIS_AND_STICKERS * tests/stickers: delete sticker after test createGuildSticker: add send sticker test getGuildStickers: create another sticker then test > 1 stickers
19 lines
672 B
TypeScript
19 lines
672 B
TypeScript
import { Bot } from "../../bot.ts";
|
|
import { Sticker } from "../../mod.ts";
|
|
import { DiscordSticker } from "../../types/discord.ts";
|
|
|
|
/**
|
|
* Returns a sticker object for the given sticker ID.
|
|
*
|
|
* @param bot The bot instance to use to make the request.
|
|
* @param stickerId The ID of the sticker to get
|
|
* @returns A {@link Sticker}
|
|
*
|
|
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
|
*/
|
|
export async function getSticker(bot: Bot, stickerId: bigint): Promise<Sticker> {
|
|
const result = await bot.rest.runMethod<DiscordSticker>(bot.rest, "GET", bot.constants.routes.STICKER(stickerId));
|
|
|
|
return bot.transformers.sticker(bot, result);
|
|
}
|