This commit is contained in:
ITOH
2021-04-24 19:39:40 +02:00
parent 6eec266c60
commit d7015df65f
2 changed files with 3 additions and 13 deletions
+2 -8
View File
@@ -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<GetGatewayBot>("get", endpoints.GATEWAY_BOT);
}