-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
28 lines (21 loc) · 705 Bytes
/
Copy pathmain.js
File metadata and controls
28 lines (21 loc) · 705 Bytes
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
'use strict';
require('dotenv').config();
var eventLogging = require('./lib/eventLogging');
var parser = require('./lib/parser');
var Discord = require('discord.js');
var utils = require('./lib/utils');
var bot = new Discord.Client();
var commandMap = utils.getMap();
bot.on('voiceJoin', function (channel, user) {
eventLogging.history('join', bot, channel, user);
});
bot.on('voiceLeave', function (channel, user) {
eventLogging.history('leave', bot, channel, user);
});
bot.on('presence', function (oldUser, newUser) {
eventLogging.presenceUpdated(oldUser, newUser, bot);
});
bot.on('message', function (msg) {
parser(bot, msg, commandMap);
});
bot.loginWithToken(process.env.BOT_TOKEN);