buddy

node MVC discord bot
Log | Files | Refs | README

WebhooksUpdate.js (554B)


      1 'use strict';
      2 
      3 const Action = require('./Action');
      4 const { Events } = require('../../util/Constants');
      5 
      6 class WebhooksUpdate extends Action {
      7   handle(data) {
      8     const client = this.client;
      9     const channel = client.channels.cache.get(data.channel_id);
     10     /**
     11      * Emitted whenever a guild text channel has its webhooks changed.
     12      * @event Client#webhookUpdate
     13      * @param {TextChannel} channel The channel that had a webhook update
     14      */
     15     if (channel) client.emit(Events.WEBHOOKS_UPDATE, channel);
     16   }
     17 }
     18 
     19 module.exports = WebhooksUpdate;