backport: WEBHOOKS_UPDATE event (#2779)

This commit is contained in:
Kyra
2018-08-26 18:59:15 +02:00
committed by Isabella
parent 93bf430fc7
commit 453098117f
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
const AbstractHandler = require('./AbstractHandler');
const { Events } = require('../../../../util/Constants');
class WebhooksUpdate extends AbstractHandler {
handle(packet) {
const client = this.packetManager.client;
const data = packet.d;
const channel = client.channels.get(data.channel_id);
if (channel) client.emit(Events.WEBHOOKS_UPDATE, channel);
}
}
/**
* Emitted whenever a guild text channel has its webhooks changed.
* @event Client#webhookUpdate
* @param {TextChannel} channel The channel that had a webhook update
*/
module.exports = WebhooksUpdate;