-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
45 lines (41 loc) · 1.18 KB
/
index.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
35
36
37
38
39
40
41
42
43
44
45
const Discord = require("discord.js");
const client = new Discord.Client({ disableMentions: 'everyone' });
const Eco = require("quick.eco");
client.eco = new Eco.Manager(); // quick.eco
client.db = Eco.db; // quick.db
client.config = require("./botConfig");
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
client.shop = {
laptop: {
cost: 2000
},
mobile: {
cost: 1000
},
pc: {
cost: 3000
}
};
const fs = require("fs");
fs.readdir("./events/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
const event = require(`./events/${f}`);
let eventName = f.split(".")[0];
client.on(eventName, event.bind(null, client));
});
});
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(`./commands/${f}`);
client.commands.set(command.help.name, command);
command.help.aliases.forEach(alias => {
client.aliases.set(alias, command.help.name);
});
});
});
client.login(client.config.token);