Bug fixes and ~~performance~~ typing improvements
diff --git a/src/index.ts b/src/index.ts
index e40a816..87bbc02 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,9 +1,11 @@
import { Logger } from "./utils/log.js";
import runServer from "./api/index.js";
import Memory from "./utils/memory.js";
+import type { VerifySchema } from "./reflex/verify.js";
import { Guilds, History, ModNotes, Premium } from "./utils/database.js";
import client from "./utils/client.js";
import EventScheduler from "./utils/eventScheduler.js";
+import type { RoleMenuSchema } from "./actions/roleMenu.js";
await client.registerCommandsIn(`dist/commands`);
await client.registerEventsIn(`dist/events`);
@@ -14,17 +16,23 @@
console.error(err);
});
-client.logger = new Logger();
-client.verify = {};
-client.roleMenu = {};
-client.memory = new Memory();
-client.noLog = [];
+client.logger = new Logger() as Logger;
+client.verify = {} as Record<string, VerifySchema>;
+client.roleMenu = {} as Record<string, RoleMenuSchema>;
+client.memory = new Memory() as Memory;
+client.noLog = [] as string[];
client.database = {
guilds: await new Guilds().setup(),
history: await new History().setup(),
notes: await new ModNotes().setup(),
premium: await new Premium().setup(),
eventScheduler: await new EventScheduler().start()
+} as {
+ guilds: Guilds;
+ history: History;
+ notes: ModNotes;
+ premium: Premium;
+ eventScheduler: EventScheduler;
};
await client.login();