From d7015df65fb05a6f2b9167a40e5044159d7177b3 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Sat, 24 Apr 2021 19:39:40 +0200 Subject: [PATCH] misc --- src/helpers/misc/get_gateway_bot.ts | 10 ++-------- src/helpers/misc/get_user.ts | 6 +----- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/helpers/misc/get_gateway_bot.ts b/src/helpers/misc/get_gateway_bot.ts index 10aa515c2..d765780be 100644 --- a/src/helpers/misc/get_gateway_bot.ts +++ b/src/helpers/misc/get_gateway_bot.ts @@ -1,14 +1,8 @@ import { rest } from "../../rest/rest.ts"; -import { - DiscordGetGatewayBot, - GetGatewayBot, -} from "../../types/gateway/get_gateway_bot.ts"; +import { GetGatewayBot } from "../../types/gateway/get_gateway_bot.ts"; import { endpoints } from "../../util/constants.ts"; -import { snakeKeysToCamelCase } from "../../util/utils.ts"; /** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */ export async function getGatewayBot() { - const result = await rest.runMethod("get", endpoints.GATEWAY_BOT); - - return snakeKeysToCamelCase(result as DiscordGetGatewayBot) as GetGatewayBot; + return await rest.runMethod("get", endpoints.GATEWAY_BOT); } diff --git a/src/helpers/misc/get_user.ts b/src/helpers/misc/get_user.ts index 254779a7f..9913acddc 100644 --- a/src/helpers/misc/get_user.ts +++ b/src/helpers/misc/get_user.ts @@ -1,12 +1,8 @@ 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(result); + return await rest.runMethod("get", endpoints.USER(userId)); }