mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57: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
27 lines
1015 B
TypeScript
27 lines
1015 B
TypeScript
import { Bot } from "../../bot.ts";
|
|
import { Sticker } from "../../transformers/sticker.ts";
|
|
|
|
/**
|
|
* Delete a new sticker for the guild.
|
|
*
|
|
* @param bot The bot instance to use to make the request.
|
|
* @param guildId The ID of the guild to get
|
|
* @return A {@link Sticker}
|
|
*
|
|
* @remarks
|
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
* Fires a Guild Stickers Update Gateway event.
|
|
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
*
|
|
* @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
|
|
*/
|
|
export async function deleteGuildSticker(bot: Bot, guildId: bigint, stickerId: bigint, reason?: string): Promise<void> {
|
|
return await bot.rest.runMethod<void>(
|
|
bot.rest,
|
|
"DELETE",
|
|
bot.constants.routes.GUILD_STICKER(guildId, stickerId),
|
|
reason ? { reason } : undefined,
|
|
);
|
|
}
|