pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 1 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 2 | import { Logger } from "./utils/log.js"; |
| 3 | import runServer from "./api/index.js"; |
| 4 | import Memory from "./utils/memory.js"; |
| 5 | import { Guilds, History, ModNotes, Premium } from "./utils/database.js"; |
| 6 | import client from "./utils/client.js"; |
| 7 | import EventScheduler from "./utils/eventScheduler.js"; |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 8 | |
| 9 | await client.registerCommandsIn("./commands"); |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 10 | await client.registerEventsIn("./events"); |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 11 | client.on("ready", () => { |
| 12 | runServer(client); |
| 13 | }); |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 14 | process.on("unhandledRejection", (err) => { |
| 15 | console.error(err); |
| 16 | }); |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 17 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 18 | client.logger = new Logger(); |
| 19 | client.verify = {}; |
| 20 | client.roleMenu = {}; |
| 21 | client.memory = new Memory(); |
| 22 | client.noLog = []; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 23 | client.database = { |
| 24 | guilds: await new Guilds().setup(), |
| 25 | history: await new History().setup(), |
| 26 | notes: await new ModNotes().setup(), |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 27 | premium: await new Premium().setup(), |
| 28 | eventScheduler: await new EventScheduler().start() |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 29 | }; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame] | 30 | |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 31 | await client.login(); |