Files
discordeno/tests/helpers/invites/deleteInvite.ts
2021-11-14 18:46:44 +01:00

20 lines
485 B
TypeScript

import { Bot } from "../../../src/bot.ts";
import { assertExists } from "../../deps.ts";
export async function deleteInviteTest(bot: Bot, channelId: bigint, t: Deno.TestContext) {
const invite = await bot.helpers.createInvite(channelId, {
maxAge: 86400,
maxUses: 0,
temporary: false,
unique: false,
});
// Assertions
assertExists(invite);
const deletedInvite = await bot.helpers.deleteInvite(invite.code);
// Assertions
assertExists(deletedInvite);
}