-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
35 lines (26 loc) · 967 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
// omnibot - a discord bot
var discordie = require("discordie"),
fs = require("fs");
var commandeer = require("./lib/commandeer.js"),
commands = require("./lib/commands.js"),
webserver = require("./lib/web/webserver.js"),
mods = require("./lib/mods.js");
console.log("[omni/CORE] Starting OmniBot v0.1");
var config = JSON.parse(fs.readFileSync(__dirname + "/config/config.json", 'utf8'));
var bot = new discordie();
bot.connect({
token: config.token
});
bot.Dispatcher.on(discordie.Events.GATEWAY_READY, function(e) {
global.InviteManager = bot.Invites;
global.bot_id = bot.User.id;
global.bot = bot.User;
global.discordie = bot;
//bot.User.edit(null, null, fs.readFileSync("profile.png")); // temp profile update
mods.loader.load(commandeer);
webserver.start();
console.log("[omni/CORE] OmniBot started. Username: " + bot.User.username);
});
bot.Dispatcher.on(discordie.Events.MESSAGE_CREATE, function(e) {
commandeer.dispatch(e.message);
});