mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Update follow_channel.ts
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { rest } from "../../rest/rest.ts";
|
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 { endpoints } from "../../util/constants.ts";
|
||||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||||
|
|
||||||
@@ -10,10 +10,13 @@ export async function followChannel(
|
|||||||
) {
|
) {
|
||||||
await requireBotChannelPermissions(targetChannelId, ["MANAGE_WEBHOOKS"]);
|
await requireBotChannelPermissions(targetChannelId, ["MANAGE_WEBHOOKS"]);
|
||||||
|
|
||||||
const data =
|
const data = await rest.runMethod<FollowedChannel>(
|
||||||
(await rest.runMethod("post", endpoints.CHANNEL_FOLLOW(sourceChannelId), {
|
"post",
|
||||||
|
endpoints.CHANNEL_FOLLOW(sourceChannelId),
|
||||||
|
{
|
||||||
webhook_channel_id: targetChannelId,
|
webhook_channel_id: targetChannelId,
|
||||||
})) as DiscordFollowedChannel;
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return data.webhook_id;
|
return data.webhookId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user