refactor(handlers): resolve RequestManager.<method> using await before returning the value (#468)

* Update channel.ts

* Update gateway.ts

* Update guild.ts

* Update member.ts

* Update message.ts

* Update oauth.ts

* Update webhook.ts

* move things arrouond

* Update guild.ts

* Update src/api/handlers/webhook.ts

* stop linter complains

* add this back

Co-authored-by: Ayyan <ayyantee@gmail.com>
This commit is contained in:
ITOH
2021-01-26 07:43:45 +00:00
committed by GitHub
parent 17959bc1c8
commit 7c3743e024
7 changed files with 305 additions and 120 deletions
+6 -4
View File
@@ -3,8 +3,10 @@ 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
>;
export async function getApplicationInformation() {
const result = await RequestManager.get(
endpoints.OAUTH2_APPLICATION,
);
return result as OAuthApplication;
}