Update get_active_threads.ts

This commit is contained in:
ITOH
2021-06-09 21:17:42 +02:00
parent 78bcd33099
commit 49f0dbb72f
@@ -1,9 +1,11 @@
import { rest } from "../../../rest/rest.ts"; import { rest } from "../../../rest/rest.ts";
import { endpoints } from "../../../util/constants.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. */ /** 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) { export async function getActiveThreads(channelId: bigint) {
// TODO(threads): perm check await requireBotChannelPermissions(channelId, ["READ_MESSAGE_HISTORY"]);
// TODO(threads): test if it works
// TODO: v12 map the result to a nice collection
return await rest.runMethod("get", endpoints.THREAD_ACTIVE(channelId)); return await rest.runMethod("get", endpoints.THREAD_ACTIVE(channelId));
} }