This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
64 lines (59 loc) · 1.99 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const Discord = require("discord.js");
const config = require("./config.json");
const package = require("./package.json");
const client = new Discord.Client();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
client.on("message", async function(message) {
if (message.author.bot) return;
if (!message.content.startsWith(config.prefix)) return;
const commandBody = message.content.slice(config.prefix.length);
const args = commandBody.split(' ');
const command = args.shift().toLowerCase();
const ping = require("./commands/ping.js");
const help = require("./commands/help");
const say = require("./commands/say");
const coucou = require("./commands/coucou.js");
const reboot = require("./commands/reboot.js");
const version = require("./commands/version.js");
const floguihug = require("./commands/floguihug.js");
const stop = require("./commands/stop.js");
const clear = require("./commands/clear.js");
const to_console = require("./commands/to_console.js");
switch (command) {
case help.name:
help.execute(message, args);
break;
case ping.name:
ping.execute(message, args);
break;
case coucou.name:
coucou.execute(message, args);
break;
case say.name:
say.execute(message, args);
break;
case floguihug.name:
floguihug.execute(message, args);
break;
case version.name:
version.execute(message, args);
break;
case reboot.name:
reboot.execute(message, args);
break;
case stop.name:
stop.execute(message, args);
break;
case clear.name:
clear.execute(message, args);
break;
case to_console.name:
to_console.execute(message, args);
break
default:
break;
}
});
client.login(config.BOT_TOKEN);