feat: add typeguards to webhooks (#6850)

This commit is contained in:
Suneet Tipirneni
2021-10-19 10:11:21 -04:00
committed by GitHub
parent 4dff279a6f
commit e0afcadda4
3 changed files with 41 additions and 2 deletions

View File

@@ -395,6 +395,22 @@ class Webhook {
return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size);
}
/**
* Whether or not this webhook is a channel follower webhook.
* @returns {boolean}
*/
isChannelFollower() {
return this.type === WebhookTypes['Channel Follower'];
}
/**
* Whether or not this webhook is an incoming webhook.
* @returns {boolean}
*/
isIncoming() {
return this.type === WebhookTypes.Incoming;
}
static applyToClass(structure, ignore = []) {
for (const prop of [
'send',