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,44 +1,36 @@
'use strict';
const Action = require('./Action');
const Constants = require('../../util/Constants');
const Message = require('../../structures/Message');
class ChannelDeleteAction extends Action {
constructor(client) {
super(client);
this.timeouts = [];
this.deleted = {};
}
handle(data) {
let client = this.client;
let channel = client.store.get('channels', data.id);
if (channel) {
client.store.KillChannel(channel);
this.deleted[channel.id] = channel;
this.scheduleForDeletion(channel.id);
} else if (this.deleted[data.id]) {
channel = this.deleted[data.id];
}
return {
channel,
};
}
scheduleForDeletion(id) {
this.timeouts.push(
setTimeout(() => delete this.deleted[id],
this.client.options.rest_ws_bridge_timeout)
);
}
};
module.exports = ChannelDeleteAction;
const Action = require('./Action');
class ChannelDeleteAction extends Action {
constructor(client) {
super(client);
this.timeouts = [];
this.deleted = {};
}
handle(data) {
const client = this.client;
let channel = client.store.get('channels', data.id);
if (channel) {
client.store.killChannel(channel);
this.deleted[channel.id] = channel;
this.scheduleForDeletion(channel.id);
} else if (this.deleted[data.id]) {
channel = this.deleted[data.id];
}
return {
channel,
};
}
scheduleForDeletion(id) {
this.timeouts.push(
setTimeout(() => delete this.deleted[id],
this.client.options.rest_ws_bridge_timeout)
);
}
}
module.exports = ChannelDeleteAction;