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