mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 05:23:31 +01:00
types(Webhook): More accurate type for sourceChannel (#6751)
This commit is contained in:
@@ -98,7 +98,7 @@ class Webhook {
|
|||||||
if ('source_channel' in data) {
|
if ('source_channel' in data) {
|
||||||
/**
|
/**
|
||||||
* The source channel of the webhook
|
* The source channel of the webhook
|
||||||
* @type {?(Channel|APIChannel)}
|
* @type {?(NewsChannel|APIChannel)}
|
||||||
*/
|
*/
|
||||||
this.sourceChannel = this.client.channels?.resolve(data.source_channel?.id) ?? data.source_channel;
|
this.sourceChannel = this.client.channels?.resolve(data.source_channel?.id) ?? data.source_channel;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -2135,7 +2135,7 @@ export class Webhook extends WebhookMixin() {
|
|||||||
public name: string;
|
public name: string;
|
||||||
public owner: User | APIUser | null;
|
public owner: User | APIUser | null;
|
||||||
public sourceGuild: Guild | APIPartialGuild | null;
|
public sourceGuild: Guild | APIPartialGuild | null;
|
||||||
public sourceChannel: Channel | APIPartialChannel | null;
|
public sourceChannel: NewsChannel | APIPartialChannel | null;
|
||||||
public token: string | null;
|
public token: string | null;
|
||||||
public type: WebhookType;
|
public type: WebhookType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user