pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame^] | 1 | |
pineafan | dd1155e | 2022-02-26 22:06:12 +0000 | [diff] [blame] | 2 | import config from './config/main.json' assert {type: 'json'}; |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 3 | import { Logger } from './utils/log.js'; |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 4 | import runServer from './api/index.js'; |
| 5 | import Memory from './utils/memory.js'; |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame^] | 6 | import Database from './utils/database.js'; |
| 7 | import client from './utils/client.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 | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 14 | |
| 15 | client.logger = new Logger() |
| 16 | client.verify = {} |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 17 | client.roleMenu = {} |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 18 | client.memory = new Memory() |
pineafan | 6fb3e07 | 2022-05-20 19:27:23 +0100 | [diff] [blame^] | 19 | client.database = await new Database(config.mongoUrl).connect() |
| 20 | |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 21 | |
| 22 | await client.login(); |