-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiscMain.js
62 lines (44 loc) · 1.42 KB
/
discMain.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
const Discord = require('discord.js');
const commando = require('discord.js-commando');
const fs = require('fs');
const PREFIX = '!';
const bot = new Discord.Client();
var yourBotToken = 'YOUR_BOT_TOKEN'
bot.login(yourBotToken);
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}
bot.on('ready', () => {
console.log('I am ready!');
});
bot.on('message', message=>{
let args = message.content.substring(PREFIX.length).split(" ")
switch(args[0]){
case 'ping':
bot.commands.get('ping').execute(message, args);
break;
case 'tx':
bot.commands.get('tx').execute(message,args);
break;
case 'trollbox':
bot.commands.get('trollbox').execute(message, args);
break;
case 'trigger':
bot.commands.get('trigger').execute(message, args);
break;
case 'whale':
bot.commands.get('whale').execute(message, args);
/*
case 'balance':
if(args[1] == null){
message.channel.send('!balance + ETH adress required');
} else {
bot.commands.get('ethBalance1').execute(message, args[1]);
}
break;
*/
}
})