-
-
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.
feat: handle and forward WEBHOOKS_UPDATE events (#2762)
* src: Handle WEBHOOK_UPDATE events * Commit rename of 77' Or adding the letter S * I missed this * Properly do this now Typos everywhere * Typings * refactor: remove now unnecessary guild variable
- Loading branch information
1 parent
ab0ede0
commit 0401b8a
Showing
4 changed files
with
28 additions
and
2 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
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