mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
feat(handlers): add getGatewayBot() & getApplicationInformation() (#428)
* feat(handlers): add getGatewayBot() * refactor(bot): use getGatewayBot() to get gateway data * feat(handlers): add getApplicationInformation * add(handlers): getApplicationInformation jsdoc * Add oauth required types * create separate file * delete misc * OAuthApplication * forgot to update import * idk why that was here
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { RequestManager } from "../../rest/request_manager.ts";
|
||||
import { DiscordBotGatewayData } from "../../types/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
||||
export function getGatewayBot() {
|
||||
return RequestManager.get(
|
||||
endpoints.GATEWAY_BOT,
|
||||
) as Promise<DiscordBotGatewayData>;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { RequestManager } from "../../rest/request_manager.ts";
|
||||
import { OAuthApplication } from "../../types/oauth.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Returns the bot's OAuth2 application object without `flags`. */
|
||||
export function getApplicationInformation() {
|
||||
return RequestManager.get(endpoints.OAUTH2_APPLICATION) as Promise<
|
||||
OAuthApplication
|
||||
>;
|
||||
}
|
||||
Reference in New Issue
Block a user