Files
discord.js/src/client/websocket/packets/handlers/ChannelUpdate.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

21 lines
738 B
JavaScript

const AbstractHandler = require('./AbstractHandler');
const Constants = require('../../../../util/Constants');
class ChannelUpdateHandler extends AbstractHandler {
handle(packet) {
const { old, updated } = this.packetManager.client.actions.ChannelUpdate.handle(packet.d);
if (old && updated) {
this.packetManager.client.emit(Constants.Events.CHANNEL_UPDATE, old, updated);
}
}
}
module.exports = ChannelUpdateHandler;
/**
* Emitted whenever a channel is updated - e.g. name change, topic change.
* @event Client#channelUpdate
* @param {DMChannel|GroupDMChannel|GuildChannel} oldChannel The channel before the update
* @param {DMChannel|GroupDMChannel|GuildChannel} newChannel The channel after the update
*/