From 51c5e79ffc22c684c92c1e0c3464aacb070b2c0a Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 19 Jan 2022 22:18:52 +0100 Subject: [PATCH] adds eventhandler --- server/eventHandler.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 server/eventHandler.ts diff --git a/server/eventHandler.ts b/server/eventHandler.ts new file mode 100644 index 0000000..1acc04c --- /dev/null +++ b/server/eventHandler.ts @@ -0,0 +1,22 @@ +import { Collection, Guild, GuildScheduledEvent, Snowflake } from "discord.js"; + +export default class eventHandler { + + public constructor() { + console.log('constructed') + } + public listAllEvents(guild: Guild): string { + + const eventManager = guild.scheduledEvents + const events: Collection = eventManager.cache + const entries = events.values() + let output = "" + + for (const e of entries) { + console.log(e) + output += e.toString() + } + console.log(output) + return output + } +}