diff --git a/index.d.ts b/index.d.ts index 72c76a272..98e461244 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2191,7 +2191,7 @@ declare namespace Eris { executeSlackWebhook(webhookID: string, token: string, options: Record & { auth?: boolean; threadID?: string; wait: true }): Promise>; executeWebhook(webhookID: string, token: string, options: WebhookPayload & { wait: true }): Promise>; executeWebhook(webhookID: string, token: string, options: WebhookPayload): Promise; - followChannel(channelID: string, webhookChannelID: string): Promise; + followChannel(channelID: string, webhookChannelID: string, reason?: string): Promise; getActiveGuildThreads(guildID: string): Promise; getArchivedThreads(channelID: string, type: "private", options?: GetArchivedThreadsOptions): Promise>; getArchivedThreads(channelID: string, type: "public", options?: GetArchivedThreadsOptions): Promise>>; @@ -3064,7 +3064,7 @@ declare namespace Eris { type: Constants["ChannelTypes"]["GUILD_NEWS"]; crosspostMessage(messageID: string): Promise>; edit(options: EditNewsChannelOptions, reason?: string): Promise; - follow(webhookChannelID: string): Promise; + follow(webhookChannelID: string, reason?: string): Promise; } export class NewsThreadChannel extends ThreadChannel { diff --git a/lib/Client.js b/lib/Client.js index 9589442d6..c0c2bfe34 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -2367,11 +2367,12 @@ class Client extends EventEmitter { /** * Follow a NewsChannel in another channel. This creates a webhook in the target channel * @arg {String} channelID The ID of the NewsChannel - * @arg {String} webhookChannelID The ID of the target channel + * @arg {String} options.webhookChannelID The ID of the target channel + * @arg {String} [reason] The reason to be displayed in audit logs * @returns {Object} An object containing the NewsChannel's ID and the new webhook's ID */ - followChannel(channelID, webhookChannelID) { - return this.requestHandler.request("POST", Endpoints.CHANNEL_FOLLOW(channelID), true, { webhook_channel_id: webhookChannelID }); + followChannel(channelID, webhookChannelID, reason) { + return this.requestHandler.request("POST", Endpoints.CHANNEL_FOLLOW(channelID), true, { webhook_channel_id: webhookChannelID, reason: reason }); } /** diff --git a/lib/structures/NewsChannel.js b/lib/structures/NewsChannel.js index 91f00d183..5de6b2987 100644 --- a/lib/structures/NewsChannel.js +++ b/lib/structures/NewsChannel.js @@ -23,10 +23,11 @@ class NewsChannel extends TextChannel { /** * Follow this channel in another channel. This creates a webhook in the target channel * @arg {String} webhookChannelID The ID of the target channel + * @arg {String} [reason] The reason to be displayed in audit logs * @returns {Object} An object containing this channel's ID and the new webhook's ID */ - follow(webhookChannelID) { - return this._client.followChannel.call(this._client, this.id, webhookChannelID); + follow(webhookChannelID, reason) { + return this._client.followChannel.call(this._client, this.id, webhookChannelID, reason); } }