mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 07:50:07 +00:00
15 lines
525 B
TypeScript
15 lines
525 B
TypeScript
import { assertExists } from "../../deps.ts";
|
|
import { bot } from "../../mod.ts";
|
|
import { delayUntil } from "../../utils.ts";
|
|
|
|
export async function createRoleTests(guildId: bigint, options: { reason?: string }) {
|
|
const role = await bot.helpers.createRole(guildId, { name: "hoti" }, options.reason);
|
|
|
|
assertExists(role);
|
|
|
|
// Delay the execution to allow event to be processed
|
|
await delayUntil(10000, () => bot.guilds.get(guildId)?.roles.has(role.id));
|
|
|
|
assertExists(bot.guilds.get(guildId)?.roles.has(role.id));
|
|
}
|