Skip to content

Commit efb3fc8

Browse files
author
Project Econome
committed
Add ClientReady event
1 parent da276bc commit efb3fc8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/handlers/events/clientReady.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Interpreter } from "../../core"
2+
import { Logger } from "../../structures"
3+
import { DiscordEventHandler } from "../../structures/extended/DiscordEventHandler"
4+
import { InviteTracker } from "../../structures/trackers/InviteTracker"
5+
6+
export default new DiscordEventHandler({
7+
name: "clientReady",
8+
version: "2.4.2",
9+
description: "This event is fired when the bot becomes ready",
10+
listener: async function () {
11+
const commands = this.commands.get("clientReady")
12+
if (commands.length) {
13+
for (const command of commands) {
14+
Interpreter.run({
15+
client: this,
16+
command,
17+
data: command.compiled.code,
18+
obj: {},
19+
})
20+
}
21+
} else {
22+
Logger.info(`Ready on client ${this.user.displayName}`)
23+
}
24+
25+
if (this.options.trackers?.invites) {
26+
await InviteTracker.cacheAll(this)
27+
}
28+
},
29+
})

0 commit comments

Comments
 (0)