From 49f0dbb72f24f14c65343d0117372ee07a1bf8ac Mon Sep 17 00:00:00 2001 From: ITOH Date: Wed, 9 Jun 2021 21:17:42 +0200 Subject: [PATCH] Update get_active_threads.ts --- src/helpers/channels/threads/get_active_threads.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/helpers/channels/threads/get_active_threads.ts b/src/helpers/channels/threads/get_active_threads.ts index eb7473f7d..c74326987 100644 --- a/src/helpers/channels/threads/get_active_threads.ts +++ b/src/helpers/channels/threads/get_active_threads.ts @@ -1,9 +1,11 @@ import { rest } from "../../../rest/rest.ts"; import { endpoints } from "../../../util/constants.ts"; +import { requireBotChannelPermissions } from "../../../util/permissions.ts"; /** Returns all active threads in the channel, including public and private threads. Threads are ordered by their id, in descending order. Requires the READ_MESSAGE_HISTORY permission. */ export async function getActiveThreads(channelId: bigint) { - // TODO(threads): perm check - // TODO(threads): test if it works + await requireBotChannelPermissions(channelId, ["READ_MESSAGE_HISTORY"]); + + // TODO: v12 map the result to a nice collection return await rest.runMethod("get", endpoints.THREAD_ACTIVE(channelId)); }