ESLint stuff...

This commit is contained in:
Amish Shah
2016-08-13 14:44:49 +01:00
parent 53d767ec04
commit b8db4c4f4b
74 changed files with 2574 additions and 2956 deletions

View File

@@ -1,39 +1,31 @@
'use strict';
const Action = require('./Action');
const Constants = require('../../util/Constants');
const CloneObject = require('../../util/CloneObject');
const Message = require('../../structures/Message');
const cloneObject = require('../../util/CloneObject');
class ChannelUpdateAction extends Action {
constructor(client) {
super(client);
}
handle(data) {
const client = this.client;
const channel = client.store.get('channels', data.id);
handle(data) {
if (channel) {
const oldChannel = cloneObject(channel);
channel.setup(data);
if (!oldChannel.equals(data)) {
client.emit(Constants.Events.CHANNEL_UPDATE, oldChannel, channel);
}
let client = this.client;
let channel = client.store.get('channels', data.id);
return {
old: oldChannel,
updated: channel,
};
}
if (channel) {
let oldChannel = CloneObject(channel);
channel.setup(data);
if (!oldChannel.equals(data)) {
client.emit(Constants.Events.CHANNEL_UPDATE, oldChannel, channel);
}
return {
old: oldChannel,
updated: channel,
};
}
return {
old: null,
updated: null,
};
}
};
return {
old: null,
updated: null,
};
}
}
module.exports = ChannelUpdateAction;