mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 16:00:07 +00:00
20 lines
491 B
TypeScript
20 lines
491 B
TypeScript
import { Bot } from "../../../bot.ts";
|
|
import { assertEquals, assertExists } from "../../deps.ts";
|
|
|
|
export async function getInviteTest(channelId: bigint) {
|
|
const invite = await bot.helpers.createInvite(channelId, {
|
|
maxAge: 86400,
|
|
maxUses: 0,
|
|
temporary: false,
|
|
unique: false,
|
|
});
|
|
|
|
// Assertions
|
|
assertExists(invite);
|
|
|
|
const fetchedInvite = await bot.helpers.getInvite(invite.code);
|
|
|
|
assertExists(fetchedInvite);
|
|
assertEquals(fetchedInvite.code, invite.code);
|
|
}
|