mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
* improve channel documentation * forgot some stuff * another one * im good at this * i did a dum
30 lines
664 B
JavaScript
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;
|