mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
some moar fixes lol
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
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 = await rest.runMethod("get", endpoints.USER(userId));
|
||||
const result: User = await rest.runMethod("get", endpoints.USER(userId));
|
||||
|
||||
return result as UserPayload;
|
||||
return snakeKeysToCamelCase<DiscordUser>(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user