Added channel.delete()

This commit is contained in:
hydrabolt
2016-04-27 16:25:57 +01:00
parent b436fac5c4
commit 2341c83638
7 changed files with 51 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ class ActionsManager {
this.register('MessageDelete');
this.register('MessageUpdate');
this.register('ChannelCreate');
this.register('ChannelDelete');
}
register(name) {

View File

@@ -0,0 +1,27 @@
'use strict';
const Action = require('./Action');
const Constants = require('../../util/Constants');
const Message = require('../../structures/Message');
class ChannelDeleteAction extends Action {
constructor(client) {
super(client);
}
handle(data) {
let client = this.client;
let channel = client.store.get('channels', data.id);
if (channel) {
client.store.KillChannel(channel);
}
return {
channel,
};
}
};
module.exports = ChannelDeleteAction;