mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
21 lines
685 B
TypeScript
21 lines
685 B
TypeScript
import { assertExists } from "../deps.ts";
|
|
import { createRoleTests } from "../helpers/roles/createRole.ts";
|
|
import { bot, guild } from "../mod.ts";
|
|
import { delayUntil } from "../utils.ts";
|
|
|
|
Deno.test({
|
|
name: "[Role] create a role with a reason",
|
|
fn: async (t) => {
|
|
await createRoleTests(bot, guild.id, { reason: "Blame wolfy" }, t);
|
|
|
|
const role = await bot.helpers.createRole(guild.id, { name: "hoti" }, "Blame wolfy");
|
|
|
|
assertExists(role);
|
|
|
|
// Delay the execution to allow event to be processed
|
|
await delayUntil(10000, () => bot.cache.guilds.get(guild.id)?.roles.has(role.id));
|
|
|
|
assertExists(bot.cache.guilds.get(guild.id)?.roles.has(role.id));
|
|
},
|
|
});
|