mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-17 11:48:17 +00:00
13 lines
563 B
TypeScript
13 lines
563 B
TypeScript
import { rest } from "../../rest/rest.ts";
|
|
import { DiscordUser } from "../../types/users/user.ts";
|
|
import { User } from "../../types/users/user.ts";
|
|
import { endpoints } from "../../util/constants.ts";
|
|
import { snakeKeysToCamelCase } from "../../util/utils.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(userId: string) {
|
|
const result: User = await rest.runMethod("get", endpoints.USER(userId));
|
|
|
|
return snakeKeysToCamelCase<DiscordUser>(result);
|
|
}
|