Files
discordeno/src/helpers/misc/getUser.ts
LTS20050703 3b3663f2b9 refactor: remove unused imports (#2021)
* make lib faster (delete unused import)

* Revert deno.json change

* Missing }
2022-02-09 13:38:11 +01: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);
}