A powerful and extendable Discord bot, with it's own module system :3 thevoid.cafe/projects/voidy

✨ IEvent -> Event

Jo f9fabb8d 2f778038

Changed files
+7 -7
src
core
events
loaders
+1 -1
src/core/Loader.ts
··· 20 20 } 21 21 22 22 /** 23 - * Recursively collects data from a directory based on the directory specificed in dataSource property. 23 + * Recursively collects data from a directory based on the path specificed in dataSource property. 24 24 */ 25 25 public async collect() { 26 26 const glob = new Glob(`**.ts`);
+2 -2
src/events/ready.ts
··· 1 1 import { Events } from "discord.js"; 2 - import type { IEvent } from "../loaders/EventLoader"; 2 + import type { Event } from "../loaders/EventLoader"; 3 3 4 4 export default { 5 5 name: Events.ClientReady, ··· 7 7 execute: () => { 8 8 9 9 } 10 - } as IEvent; 10 + } as Event;
+4 -4
src/loaders/EventLoader.ts
··· 1 1 import { Events } from "discord.js"; 2 2 import { Loader } from "../core/Loader"; 3 3 4 - export interface IEvent { 4 + export interface Event { 5 5 name: Events, 6 6 once?: boolean, 7 7 execute: () => void, 8 8 } 9 9 10 - export class EventLoader extends Loader<IEvent> { 11 - public override async validate(data: Partial<IEvent>) { 10 + export class EventLoader extends Loader<Event> { 11 + public override async validate(data: Partial<Event>) { 12 12 if (!data.name || !data.execute) return null; 13 - return data as IEvent; 13 + return data as Event; 14 14 } 15 15 }