mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(Webhook): add channel getter (#9074)
* fix: add channel property * fix: missing new line
This commit is contained in:
@@ -72,7 +72,7 @@ class Webhook {
|
|||||||
|
|
||||||
if ('channel_id' in data) {
|
if ('channel_id' in data) {
|
||||||
/**
|
/**
|
||||||
* The channel the webhook belongs to
|
* The id of the channel the webhook belongs to
|
||||||
* @type {Snowflake}
|
* @type {Snowflake}
|
||||||
*/
|
*/
|
||||||
this.channelId = data.channel_id;
|
this.channelId = data.channel_id;
|
||||||
@@ -376,6 +376,15 @@ class Webhook {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The channel the webhook belongs to
|
||||||
|
* @type {?(TextChannel|VoiceChannel|NewsChannel|ForumChannel)}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get channel() {
|
||||||
|
return this.client.channels.resolve(this.channelId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The timestamp the webhook was created at
|
* The timestamp the webhook was created at
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|||||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -2828,6 +2828,7 @@ export class Webhook extends WebhookMixin() {
|
|||||||
private constructor(client: Client, data?: RawWebhookData);
|
private constructor(client: Client, data?: RawWebhookData);
|
||||||
public avatar: string;
|
public avatar: string;
|
||||||
public avatarURL(options?: StaticImageURLOptions): string | null;
|
public avatarURL(options?: StaticImageURLOptions): string | null;
|
||||||
|
public readonly channel: TextChannel | VoiceChannel | NewsChannel | ForumChannel | null;
|
||||||
public channelId: Snowflake;
|
public channelId: Snowflake;
|
||||||
public client: Client;
|
public client: Client;
|
||||||
public guildId: Snowflake;
|
public guildId: Snowflake;
|
||||||
|
|||||||
Reference in New Issue
Block a user