forked from vrishinvv/discord-bot-GenuineGenie
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
65 lines (57 loc) · 1.85 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
65
require('module-alias/register');
try {
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('@root/appConfig.js');
const loadCommands = require('@root/commands/load-commands');
const loadFeatures = require('@root/features/load-features');
const { loadPrefixes } = require('./commands/command-base');
const mongo = require('@root/database/mongo');
/*
const { MongoClient } = require('mongodb');
const MongoDBProvider = require('commando-provider-mongo');
const Commando = require('discord.js-commando');
const client = new Commando.CommandoClient({
owner: '384318671037661184',
commandPrefix: '!',
}); */
client.setMaxListeners(100);
/* client.setProvider(
MongoClient.connect(config.mongoURL)
.then((client) => {
return new MongoDBProvider(client, 'lesgo');
})
.catch((err) => {
console.log(err);
})
);
*/
try {
console.log('Starting up Discord Client...');
client.on('ready', async () => {
console.log('Estabished connection with Discord...');
console.log(`Logged in as ${client.user.tag}!\n`);
await mongo();
/* client.registry
.registerGroups([
['moderation', 'moderation commands'],
['misc', 'misc commands'],
['economy', 'money and economy system commands'],
])
.registerDefaults()
.registerCommandsIn(path.join(__dirname, 'cmds')); */
// load Prefixes
loadPrefixes(client);
// Load commands
loadCommands(client);
// Load features
loadFeatures(client);
});
console.log('consoling token');
client.login(config.token);
} catch (err) {
console.log(err, '\n');
}
} catch (err) {
console.log(err, '\n');
}