Files
discordeno/src/helpers/channels/threads/getThreadMembers.ts
T
2021-11-14 18:21:11 +01:00

21 lines
691 B
TypeScript

import type { Bot } from "../../../bot.ts";
import { ThreadMember } from "../../../types/channels/threads/thread_member.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;
// }]));
}