fix(ws): startBot botGatewayData & maxShard (#839)

* this is for u tri!

* fix more
This commit is contained in:
Skillz4Killz
2021-04-12 11:39:34 -04:00
committed by GitHub
parent f488a41493
commit f7024a5bf0
6 changed files with 35 additions and 62 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import { rest } from "../../rest/rest.ts";
import { DiscordGetGatewayBot, GetGatewayBot } from "../../types/gateway/get_gateway_bot.ts";
import { endpoints } from "../../util/constants.ts";
import { camelKeysToSnakeCase } from "../../util/utils.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 camelKeysToSnakeCase(result as DiscordGetGatewayBot) as GetGatewayBot;
return snakeKeysToCamelCase(result as DiscordGetGatewayBot) as GetGatewayBot;
}