From f8f976acf4ca873bdae5b8751221c81080bc85c4 Mon Sep 17 00:00:00 2001 From: Fleny Date: Sun, 26 May 2024 20:51:00 +0200 Subject: [PATCH] Add reason to followAnnouncement (#3622) --- packages/rest/src/manager.ts | 3 ++- packages/rest/src/types.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/rest/src/manager.ts b/packages/rest/src/manager.ts index 5589686b4..fb4409da5 100644 --- a/packages/rest/src/manager.ts +++ b/packages/rest/src/manager.ts @@ -925,11 +925,12 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage return await rest.post(rest.routes.webhooks.webhook(webhookId, token, options), { body: options }) }, - async followAnnouncement(sourceChannelId, targetChannelId) { + async followAnnouncement(sourceChannelId, targetChannelId, reason) { return await rest.post(rest.routes.channels.follow(sourceChannelId), { body: { webhook_channel_id: targetChannelId, }, + reason, }) }, diff --git a/packages/rest/src/types.ts b/packages/rest/src/types.ts index 9fadd7685..7407f3aa6 100644 --- a/packages/rest/src/types.ts +++ b/packages/rest/src/types.ts @@ -1502,6 +1502,7 @@ export interface RestManager { * * @param sourceChannelId - The ID of the announcement channel to follow. * @param targetChannelId - The ID of the target channel - the channel to cross-post to. + * @param {string} [reason] - An optional reason for the action, to be included in the audit log. * @returns An instance of {@link CamelizedDiscordFollowedChannel}. * * @remarks @@ -1511,7 +1512,7 @@ export interface RestManager { * * @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel} */ - followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString) => Promise + followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString, reason?: string) => Promise /** * Gets the list of all active threads for a guild. *