mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Update get_active_threads.ts
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user