mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-01 08:30:08 +00:00
* Add "deleted" property to "Message" structure * Add "deleted" property to Multiple structures Structures edited: - Channel - Emoji - Guild - Guild Member - Role * Update "deletable" getter * Fix ESLint "no-trailing-spaces" errors * Requested Change: Mark w/ bulkDelete
31 lines
685 B
JavaScript
31 lines
685 B
JavaScript
const Action = require('./Action');
|
|
const { Events } = 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);
|
|
channel.deleted = true;
|
|
client.emit(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;
|