-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBot.ts
More file actions
27 lines (22 loc) · 789 Bytes
/
Bot.ts
File metadata and controls
27 lines (22 loc) · 789 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
import { existsSync, mkdirSync, readdirSync, realpathSync, symlinkSync } from "fs";
import { Handler } from "./bot/Handler";
class WagYourBot extends Handler {
constructor() {
super("174312969386196993");
this.on("ready", () => {
this.user?.setPresence({activities: [{ name: "bot.wagyourtail.xyz"}], status: 'online'});
console.log("ready");
});
}
registerPlugins(): void {
if (!existsSync("./plugins")) {
mkdirSync("./plugins");
}
const folders = readdirSync("./bot/plugins");
for (const plugin of folders) {
this.registerPlugin(require(`./bot/plugins/${plugin}/${plugin}.js`).plugin);
}
}
}
const bot = new WagYourBot();
bot.login().catch(console.error);