-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
49 lines (44 loc) · 1.32 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
const Discord = require('discord.js')
const debug = require('debug')('index')
const config = require('./src/config.json')
const crypto = require('./src/commands/crypto')
const coins = require('./src/commands/coins')
const help = require('./src/commands/help')
const donate = require('./src/commands/donate')
const github = require('./src/commands/github')
const discord = require('./src/commands/discord')
const token = require('./src/config.json').token
const client = new Discord.Client()
client.login(token)
client.on('ready', () => {
console.log(
`Coin bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`
)
client.user.setPresence({
game: { name: client.users.size + ' miners', type: 3 },
})
})
client.on('message', async (message) => {
if (message.content.substring(0, config.prefix.length) === config.prefix) {
const command = message.content.slice(config.prefix.length)
switch (command) {
case 'coins':
coins(message)
break
case 'help':
help(message)
break
case 'donate':
donate(message)
break
case 'github':
github(message)
break
case 'discord':
discord(message)
break
default:
crypto(message, command)
}
}
})