Files
discordeno/tests/channels/getChannels.test.ts
2022-05-31 14:22:12 +00:00

23 lines
692 B
TypeScript

import { assertEquals } from "../deps.ts";
import { loadBot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
Deno.test({
name: "[channel] Get all channels",
async fn() {
const bot = loadBot();
const [first, second] = await Promise.all([
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "first" }),
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "second" }),
]);
const channels = await bot.helpers.getChannels(CACHED_COMMUNITY_GUILD_ID);
assertEquals(channels.size > 1, true);
await Promise.all(
[bot.helpers.deleteChannel(first.id), bot.helpers.deleteChannel(second.id)],
);
},
});