mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
21 lines
691 B
TypeScript
21 lines
691 B
TypeScript
import type { Bot } from "../../../bot.ts";
|
|
import { ThreadMember } from "../../../types/channels/threads/threadMember.ts";
|
|
|
|
/** Returns thread members objects that are members of the thread. */
|
|
export async function getThreadMembers(bot: Bot, threadId: bigint) {
|
|
const result = await bot.rest.runMethod<ThreadMember[]>(
|
|
bot.rest,
|
|
"get",
|
|
bot.constants.endpoints.THREAD_MEMBERS(threadId),
|
|
);
|
|
return result;
|
|
|
|
// return new Collection(result.map((res) => [bot.transformers.snowflake(result.userId), {
|
|
// id?: string;
|
|
// /** The id of the user */
|
|
// userId?: string;
|
|
// /** The time the current user last joined the thread */
|
|
// joinTimestamp: string;
|
|
// }]));
|
|
}
|