buddy

node MVC discord bot
Log | Files | Refs | README

CHANNEL_UPDATE.js (579B)


      1 'use strict';
      2 
      3 const { Events } = require('../../../util/Constants');
      4 
      5 module.exports = (client, packet) => {
      6   const { old, updated } = client.actions.ChannelUpdate.handle(packet.d);
      7   if (old && updated) {
      8     /**
      9      * Emitted whenever a channel is updated - e.g. name change, topic change, channel type change.
     10      * @event Client#channelUpdate
     11      * @param {DMChannel|GuildChannel} oldChannel The channel before the update
     12      * @param {DMChannel|GuildChannel} newChannel The channel after the update
     13      */
     14     client.emit(Events.CHANNEL_UPDATE, old, updated);
     15   }
     16 };