mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 07:50:07 +00:00
* feat: base plugin lib idea * fix: stuff * fmt * fix: imports and exports * fix: errors & tests * fix: remove logs
27 lines
819 B
TypeScript
27 lines
819 B
TypeScript
import { assertEquals, assertExists, assertRejects } from "../deps.ts";
|
|
import { loadBot } from "../mod.ts";
|
|
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
|
|
|
|
Deno.test({
|
|
name: "[webhook] delete a webhook",
|
|
fn: async () => {
|
|
const bot = loadBot();
|
|
|
|
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "deleteWebhook" });
|
|
assertExists(channel?.id);
|
|
|
|
const webhook = await bot.helpers.createWebhook(channel.id, { name: "delete" });
|
|
assertExists(webhook?.id);
|
|
assertExists(webhook.token);
|
|
|
|
await bot.helpers.deleteWebhookWithToken(webhook.id, webhook.token);
|
|
|
|
// Fetch the webhook to validate it was deleted
|
|
await assertRejects(
|
|
() => bot.helpers.getWebhook(webhook.id),
|
|
);
|
|
|
|
await bot.helpers.deleteChannel(channel.id);
|
|
},
|
|
});
|