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)); }