-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
executable file
·33 lines (27 loc) · 854 Bytes
/
index.ts
File metadata and controls
executable file
·33 lines (27 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { readdir } from "fs";
// dotenv init is in client.ts
import { client } from "./client.ts";
import { checkReminders } from "./utils/reminders.ts";
// so it is run instantly
import "./permissions.ts";
let init = false;
client.on("ready", () => {
console.log("Ready as", client.user.tag);
if (!init) {
init = true;
readdir("./src/bangs", (err, res) => {
if (err) throw err;
else res.forEach(f => import(`./bangs/${f}`));
});
readdir("./src/commands", (err, res) => {
if (err) throw err;
else res.forEach(f => import(`./commands/${f}`));
});
readdir("./src/events", (err, res) => {
if (err) throw err;
else res.forEach(f => import(`./events/${f}`));
});
checkReminders();
}
});
client.connect();