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