const commando = require('discord.js-commando');
const moment = require('moment');
const oneLine = require('common-tags').oneLine;
const path = require('path');
const winston = require('winston');

const config = require('./settings');

const client = new commando.Client({
	owner: config.owner,
	commandPrefix: 'dude, ',
	unknownCommandResponse: false,
	disableEveryone: true,
	disabledEvents: [
		'GUILD_CREATE',
		'GUILD_DELETE',
		'GUILD_UPDATE',
		'GUILD_UNAVAILABLE',
		'GUILD_AVAILABLE',
		'GUILD_MEMBER_UPDATE',
		'GUILD_MEMBER_AVAILABLE',
		'GUILD_MEMBER_SPEAKING',
		'GUILD_ROLE_CREATE',
		'GUILD_ROLE_DELETE',
		'GUILD_ROLE_UPDATE',
		'CHANNEL_CREATE',
		'CHANNEL_DELETE',
		'CHANNEL_UPDATE',
		'CHANNEL_PINS_UPDATE',
		'MESSAGE_DELETE_BULK',
		'USER_UPDATE',
		'USER_NOTE_UPDATE',
		'PRESENCE_UPDATE',
		'TYPING_START',
		'TYPING_STOP',
		'VOICE_STATE_UPDATE',
		'FRIEND_ADD',
		'FRIEND_REMOVE'
	]
});

client.on('error', winston.error)
	.on('warn', winston.warn)
	.on('ready', () => {
		winston.info(`Client ready; logged in as ${client.user.username}#${client.user.discriminator} (${client.user.id})`);
	})
	.on('disconnect', () => { winston.warn('Disconnected!'); })
	.on('reconnect', () => { winston.warn('Reconnecting...'); })
	.on('commandError', (cmd, err) => {
		if (err instanceof commando.FriendlyError) return;
		winston.error(`Error in command ${cmd.groupID}:${cmd.memberName}`, err);
	})
	.on('commandBlocked', (msg, reason) => {
		winston.info(oneLine`
			Command ${msg.command ? `${msg.command.groupID}:${msg.command.memberName}` : ''}
			blocked; ${reason}
		`);
	})
	.on('commandPrefixChange', (guild, prefix) => {
		winston.info(oneLine`
			Prefix changed to ${prefix || 'the default'}
			${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
		`);
	})
	.on('commandStatusChange', (guild, command, enabled) => {
		winston.info(oneLine`
			Command ${command.groupID}:${command.memberName}
			${enabled ? 'enabled' : 'disabled'}
			${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
		`);
	})
	.on('groupStatusChange', (guild, group, enabled) => {
		winston.info(oneLine`
			Group ${group.id}
			${enabled ? 'enabled' : 'disabled'}
			${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
		`);
	});

client.registry
	.registerGroups([
		['info', 'Info'],
		['math', 'Math'],
		['fun', 'Fun'],
		['weather', 'Weather'],
		['music', 'Music'],
		['tags', 'Tags'],
		['rep', 'Reputation']
	])
	.registerDefaults()
	.registerCommandsIn(path.join(__dirname, 'commands'));

client.login(config.token);

@@ -457,40 +457,18 @@
 ILD_
-UNAVAILABLE',%0A%09%09'GUILD_AVAILABLE
+MEMBER_ADD
 ',%0A%09
@@ -482,21 +482,21 @@
 _MEMBER_
-UPDAT
+REMOV
 E',%0A%09%09'G
@@ -511,16 +511,13 @@
 BER_
-AVAILABL
+UPDAT
 E',%0A
@@ -535,17 +535,15 @@
 MBER
-_SPEAKING
+S_CHUNK
 ',%0A%09
@@ -617,41 +617,42 @@
 %0A%09%09'
-CHANNEL_CREATE',%0A%09%09'CHANNEL_DELET
+GUILD_BAN_ADD',%0A%09%09'GUILD_BAN_REMOV
 E',%0A
@@ -745,16 +745,15 @@
 %0A%09%09'
-USER_NOT
+PRESENC
 E_UP
@@ -754,39 +754,42 @@
 NCE_UPDATE',%0A%09%09'
-PRESENC
+VOICE_STAT
 E_UPDATE',%0A%09%09'TY
@@ -808,71 +808,42 @@
 %0A%09%09'
-TYPING_STOP',%0A%09%09'VOICE_STATE_UPDATE',%0A%09%09'FRIEND_ADD',%0A%09%09'FRIEND
+RELATIONSHIP_ADD',%0A%09%09'RELATIONSHIP
 _REM

Update Events