some moar fixes lol

This commit is contained in:
ayntee
2021-04-12 22:29:21 +04:00
parent 2a33db04fb
commit 9d5d0f0872
2 changed files with 21 additions and 10 deletions
+5 -2
View File
@@ -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);
}