Files
discordeno/tests/channels/deleteWithReason.test.ts
ITOH 03996c5f58 refactor: revert "feat: base plugin lib idea (#2308)" (#2336)
* Revert "feat: base plugin lib idea (#2308)"

This reverts commit ffe7cdbc6f.

* fmt
2022-07-02 14:24:43 +01:00

24 lines
706 B
TypeScript

import { assertEquals, assertExists } from "../deps.ts";
import { loadBot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
Deno.test({
name: "[channel] delete a channel with a reason",
async fn(t) {
const bot = loadBot();
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, {
name: "delete-channel",
});
// Make sure the channel was created
assertExists(channel.id);
// Delete the channel now with a reason
await bot.helpers.deleteChannel(channel.id, "with a reason");
// Check if channel still exists
const exists = await bot.helpers.getChannel(channel.id);
assertEquals(exists, undefined);
},
});