Files
discordeno/helpers/misc/getUser.ts
2022-02-11 09:49:53 +00:00

10 lines
427 B
TypeScript

import type { User } from "../../types/users/user.ts";
import type { Bot } from "../../bot.ts";
/** This function will return the raw user payload in the rare cases you need to fetch a user directly from the API. */
export async function getUser(bot: Bot, userId: bigint) {
const result = await bot.rest.runMethod<User>(bot.rest, "get", bot.constants.endpoints.USER(userId));
return bot.transformers.user(bot, result);
}