mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Added channel.delete()
This commit is contained in:
@@ -10,6 +10,7 @@ class ActionsManager {
|
||||
this.register('MessageDelete');
|
||||
this.register('MessageUpdate');
|
||||
this.register('ChannelCreate');
|
||||
this.register('ChannelDelete');
|
||||
}
|
||||
|
||||
register(name) {
|
||||
|
||||
27
src/client/actions/ChannelDelete.js
Normal file
27
src/client/actions/ChannelDelete.js
Normal 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;
|
||||
Reference in New Issue
Block a user