Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 1 | import { HaikuClient } from 'jshaiku'; |
| 2 | import { Intents } from 'discord.js'; |
pineafan | dd1155e | 2022-02-26 22:06:12 +0000 | [diff] [blame] | 3 | import config from './config/main.json' assert {type: 'json'}; |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 4 | import { Logger } from './utils/log.js'; |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame^] | 5 | import runServer from './api/index.js'; |
| 6 | import Memory from './utils/memory.js'; |
| 7 | |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 8 | const client = new HaikuClient({ |
| 9 | intents: new Intents(32767).bitfield, // This is a way of specifying all intents w/o having to type them out |
| 10 | }, config); |
| 11 | |
| 12 | await client.registerCommandsIn("./commands"); |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 13 | await client.registerEventsIn("./events"); |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame^] | 14 | client.on("ready", () => { |
| 15 | runServer(client); |
| 16 | }); |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 17 | |
| 18 | client.logger = new Logger() |
| 19 | client.verify = {} |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 20 | client.roleMenu = {} |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame^] | 21 | client.memory = new Memory() |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 22 | |
| 23 | await client.login(); |