2017-07-27 00:29:05 +03:00
|
|
|
const Discord = require("discord.js");
|
2017-08-11 22:48:11 +03:00
|
|
|
const DiscordUtil = require("discordjs-util");
|
2017-07-27 00:29:05 +03:00
|
|
|
|
|
|
|
const client = new Discord.Client();
|
|
|
|
|
|
|
|
process.on("uncaughtException", (err) => {
|
2017-08-11 22:48:11 +03:00
|
|
|
DiscordUtil.dateError("Uncaught exception!", err);
|
2017-07-27 00:29:05 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
client.login(require("./token.json").token);
|
|
|
|
|
|
|
|
client.on("ready", () => {
|
2017-08-11 22:48:11 +03:00
|
|
|
DiscordUtil.dateLog("Registered bot " + client.user.username);
|
2017-07-27 00:29:05 +03:00
|
|
|
require("./app/index.js")(client);
|
2017-08-11 22:48:11 +03:00
|
|
|
client.user.setGame("benji7425.github.io");
|
2017-07-27 00:29:05 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
client.on("disconnect", eventData => {
|
2017-08-11 22:48:11 +03:00
|
|
|
DiscordUtil.dateError("Bot was disconnected!", eventData.code, eventData.reason);
|
2017-07-27 00:29:05 +03:00
|
|
|
});
|