From 82b896d177af21cae61de5f63633ac16b518d930 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Fri, 23 Apr 2021 23:27:32 +0200 Subject: [PATCH] Update follow_channel.ts --- src/helpers/channels/follow_channel.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/helpers/channels/follow_channel.ts b/src/helpers/channels/follow_channel.ts index b8c9e7e27..550bf9d0f 100644 --- a/src/helpers/channels/follow_channel.ts +++ b/src/helpers/channels/follow_channel.ts @@ -1,5 +1,5 @@ import { rest } from "../../rest/rest.ts"; -import { DiscordFollowedChannel } from "../../types/channels/followed_channel.ts"; +import { FollowedChannel } from "../../types/channels/followed_channel.ts"; import { endpoints } from "../../util/constants.ts"; import { requireBotChannelPermissions } from "../../util/permissions.ts"; @@ -10,10 +10,13 @@ export async function followChannel( ) { await requireBotChannelPermissions(targetChannelId, ["MANAGE_WEBHOOKS"]); - const data = - (await rest.runMethod("post", endpoints.CHANNEL_FOLLOW(sourceChannelId), { + const data = await rest.runMethod( + "post", + endpoints.CHANNEL_FOLLOW(sourceChannelId), + { webhook_channel_id: targetChannelId, - })) as DiscordFollowedChannel; + }, + ); - return data.webhook_id; + return data.webhookId; }