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

5
typings/index.d.ts vendored
View File

@@ -2218,6 +2218,11 @@ export class Webhook extends WebhookMixin() {
public sourceChannel: NewsChannel | APIPartialChannel | null;
public token: string | null;
public type: WebhookType;
public isIncoming(): this is this & { token: string };
public isChannelFollower(): this is this & {
sourceGuild: Guild | APIPartialGuild;
sourceChannel: NewsChannel | APIPartialChannel;
};
}
export class WebhookClient extends WebhookMixin(BaseClient) {