Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport:
GUILD_INTEGRATIONS_UPDATE
event (#2794)
* backport: Client#on{guildIntegrationsUpdate,webhookUpdate} misc: Update Constants.WSEvents and WSEventType backport: Add guildIntegrationsUpdate event handler * docs: Updated typings
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/client/websocket/packets/handlers/GuildIntegrationsUpdate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters