-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (26 loc) · 888 Bytes
/
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
const Discord = require('discord.js');
const client = new Discord.Client();
const dotenv = require('dotenv');
const fs = require('fs');
dotenv.config();
const prefix = '!';
client.once('ready', () => {
console.log('ready');
client.user.setActivity('Flipando Azir level 3');
});
client.on('message', message => {
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLocaleLowerCase();
const file = './commands/' + command + '.js';
if(fs.existsSync(file)) {
require(file)(message, args);
return;
}
message.channel.startTyping();
setTimeout(() => {
message.channel.send(require('./utils/not_found')());
message.channel.stopTyping();
}, 800);
});
client.login(process.env.DISCORD_BOT_TOKEN);