mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 00:10:07 +00:00
* Create deno.json * run format * run format * ci: only check formatting * f * Update settings.json * Update settings.json
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import { ChannelTypes } from "../../mod.ts";
|
|
import { ScheduledEventEntityType, ScheduledEventPrivacyLevel } from "../../src/types/guilds/scheduledEvents.ts";
|
|
import { assertEquals, assertExists } from "../deps.ts";
|
|
import { bot, guild } from "../mod.ts";
|
|
|
|
Deno.test({
|
|
name: "[scheduled event] create a guild scheduled event with voice entity with an end time.",
|
|
fn: async (t) => {
|
|
const channel = await bot.helpers.createChannel(guild.id, {
|
|
name: "entity",
|
|
type: ChannelTypes.GuildVoice,
|
|
});
|
|
|
|
const options = {
|
|
name: "lfg",
|
|
description: "itoh is an imposter",
|
|
scheduledStartTime: Date.now() + 600000,
|
|
scheduledEndTime: Date.now() + (600000 + 1),
|
|
privacyLevel: ScheduledEventPrivacyLevel.GuildOnly,
|
|
entityType: ScheduledEventEntityType.Voice,
|
|
channelId: channel.id,
|
|
};
|
|
|
|
const event = await bot.helpers.createScheduledEvent(guild.id, options);
|
|
|
|
// Assertions
|
|
assertExists(event.id);
|
|
|
|
assertEquals(event.channelId, options.channelId);
|
|
assertEquals(event.name, options.name);
|
|
assertEquals(event.description, options.description);
|
|
assertEquals(event.scheduledStartTime, options.scheduledStartTime);
|
|
assertEquals(event.scheduledEndTime, options.scheduledEndTime);
|
|
assertEquals(event.privacyLevel, options.privacyLevel);
|
|
assertEquals(event.entityType, options.entityType);
|
|
},
|
|
});
|