Files
discord.js/src/client/actions/ChannelDelete.js
Isabella 0607720ec8 docs: improve documentation (#1898)
* improve channel documentation

* forgot some stuff

* another one

* im good at this

* i did a dum
2017-09-08 02:01:35 +02:00

30 lines
664 B
JavaScript

const Action = require('./Action');
const Constants = require('../../util/Constants');
class ChannelDeleteAction extends Action {
constructor(client) {
super(client);
this.deleted = new Map();
}
handle(data) {
const client = this.client;
let channel = client.channels.get(data.id);
if (channel) {
client.channels.remove(channel.id);
client.emit(Constants.Events.CHANNEL_DELETE, channel);
}
return { channel };
}
}
/**
* Emitted whenever a channel is deleted.
* @event Client#channelDelete
* @param {GroupDMChannel|GuildChannel} channel The channel that was deleted
*/
module.exports = ChannelDeleteAction;