-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport: WEBHOOKS_UPDATE event (#2779)
- Loading branch information
Showing
3 changed files
with
23 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
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 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; |
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