Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,7 @@ declare namespace Eris {
executeSlackWebhook(webhookID: string, token: string, options: Record<string, unknown> & { auth?: boolean; threadID?: string; wait: true }): Promise<Message<AnyGuildTextableChannel>>;
executeWebhook(webhookID: string, token: string, options: WebhookPayload & { wait: true }): Promise<Message<AnyGuildTextableChannel>>;
executeWebhook(webhookID: string, token: string, options: WebhookPayload): Promise<void>;
followChannel(channelID: string, webhookChannelID: string): Promise<ChannelFollow>;
followChannel(channelID: string, webhookChannelID: string, reason?: string): Promise<ChannelFollow>;
getActiveGuildThreads(guildID: string): Promise<ListedGuildThreads>;
getArchivedThreads(channelID: string, type: "private", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PrivateThreadChannel>>;
getArchivedThreads(channelID: string, type: "public", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PublicThreadChannel<boolean>>>;
Expand Down Expand Up @@ -3064,7 +3064,7 @@ declare namespace Eris {
type: Constants["ChannelTypes"]["GUILD_NEWS"];
crosspostMessage(messageID: string): Promise<Message<this>>;
edit(options: EditNewsChannelOptions, reason?: string): Promise<this>;
follow(webhookChannelID: string): Promise<ChannelFollow>;
follow(webhookChannelID: string, reason?: string): Promise<ChannelFollow>;
}

export class NewsThreadChannel extends ThreadChannel {
Expand Down
7 changes: 4 additions & 3 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/structures/NewsChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down