mirror of
https://github.com/danbulant/discord.js
synced 2026-05-31 21:31:29 +00:00
* backport: Client#on{guildIntegrationsUpdate,webhookUpdate}
misc: Update Constants.WSEvents and WSEventType
backport: Add guildIntegrationsUpdate event handler
* docs: Updated typings
19 lines
600 B
JavaScript
19 lines
600 B
JavaScript
const AbstractHandler = require('./AbstractHandler');
|
|
const { Events } = require('../../../../util/Constants');
|
|
|
|
class GuildIntegrationsHandler extends AbstractHandler {
|
|
handle(packet) {
|
|
const client = this.packetManager.client;
|
|
const data = packet.d;
|
|
const guild = client.guilds.get(data.guild_id);
|
|
if (guild) client.emit(Events.GUILD_INTEGRATIONS_UPDATE, guild);
|
|
}
|
|
}
|
|
|
|
module.exports = GuildIntegrationsHandler;
|
|
|
|
/**
|
|
* Emitted whenever a guild integration is updated
|
|
* @event Client#guildIntegrationsUpdate
|
|
* @param {Guild} guild The guild whose integrations were updated
|
|
*/
|