Add reason to followAnnouncement (#3622)

This commit is contained in:
Fleny
2024-05-26 18:51:00 +00:00
committed by GitHub
parent 163cebdcd0
commit f8f976acf4
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -925,11 +925,12 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
return await rest.post<DiscordMessage>(rest.routes.webhooks.webhook(webhookId, token, options), { body: options })
},
async followAnnouncement(sourceChannelId, targetChannelId) {
async followAnnouncement(sourceChannelId, targetChannelId, reason) {
return await rest.post<DiscordFollowedChannel>(rest.routes.channels.follow(sourceChannelId), {
body: {
webhook_channel_id: targetChannelId,
},
reason,
})
},
+2 -1
View File
@@ -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<CamelizedDiscordFollowedChannel>
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString, reason?: string) => Promise<CamelizedDiscordFollowedChannel>
/**
* Gets the list of all active threads for a guild.
*