-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmiku.js
34 lines (31 loc) · 966 Bytes
/
miku.js
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
34
module.exports = () => {
const Discord = require("discord.js");
const bot = new Discord.Client({
partials: ["MESSAGE", "CHANNEL", "REACTION"]
});
const fs = require("fs");
const Enmap = require("enmap");
const chalk = require("chalk");
const walker = require("walker");
require("./util/eventLoader.js")(bot);
require("./modules/function.js")(bot);
bot.config = require("./config.js").config;
bot.db = new Enmap({ name: "db" });
bot.commands = new Enmap();
bot.aliases = new Enmap();
bot.cdTime = new Enmap();
bot.commandsConf = new Enmap();
// Initialization
const init = async () => {
const folder = walker(`./commands/`).on("file", file => {
if (!file.endsWith(".js")) return;
let response = bot.loadCommand(file);
if (response) console.log(response);
});
};
// Clean all cooldowns to avoid errors
bot.db.set("cooldowns", {});
// Initialization
init();
bot.login(bot.config.token);
};