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
24 lines
953 B
TypeScript
24 lines
953 B
TypeScript
import { assertEquals } from "../deps.ts";
|
|
import { loadBot } from "../mod.ts";
|
|
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
|
|
|
|
Deno.test("[stickers] Get guild stickers", async () => {
|
|
const bot = loadBot();
|
|
const sticker1 = await bot.helpers.createGuildSticker(CACHED_COMMUNITY_GUILD_ID, {
|
|
name: "sticker 1",
|
|
description: "sticker 1",
|
|
tags: "sticker tags 1",
|
|
file: { blob: new Blob(), name: "test1.png" },
|
|
});
|
|
const sticker2 = await bot.helpers.createGuildSticker(CACHED_COMMUNITY_GUILD_ID, {
|
|
name: "sticker 2",
|
|
description: "sticker 2",
|
|
tags: "sticker tags 2",
|
|
file: { blob: new Blob(), name: "test2.png" },
|
|
});
|
|
const stickers = await bot.helpers.getGuildStickers(CACHED_COMMUNITY_GUILD_ID);
|
|
assertEquals(stickers.size > 1, true);
|
|
await bot.helpers.deleteGuildSticker(CACHED_COMMUNITY_GUILD_ID, sticker1.id);
|
|
await bot.helpers.deleteGuildSticker(CACHED_COMMUNITY_GUILD_ID, sticker2.id);
|
|
});
|