-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
35 lines (17 loc) · 829 Bytes
/
main.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
module.exports = function(client) { //Always has to be added when adding a new file to the bot
//Required constants
const prefix = "YOUR PREFIX";
const Discord = require("discord.js");
client.on("message", function(message) {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
const commandBody = message.content.slice(prefix.length);
const args = commandBody.split(' ');
const command = args.shift().toLowerCase();
//Simple latency command
if (command === "ping") {
message.channel.send(`:ping_pong: Pong **(${Date.now() - message.createdTimestamp}ms)**`)
}
// You could add more commands here
});
}; //End of the module.exports