From 464d05f5e7b3ea6f5c367c95828ee66cc7e6a2ff Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Fri, 25 Oct 2024 21:14:44 +0530 Subject: [PATCH] bot: make query() return ApiQueryResponse to avoid type errors --- src/bot.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index d70205f..8dd5781 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -77,6 +77,7 @@ import type { ApiEditResponse, ApiMoveResponse, ApiPage, + ApiQueryResponse, ApiResponse, ApiRevision, ApiRollbackResponse, @@ -555,8 +556,11 @@ export class Mwn { ); } - async query(params: ApiParams, customRequestOptions: RawRequestParams = {}): Promise { - return this.request(Object.assign({ action: 'query' }, params), customRequestOptions); + async query(params: ApiParams, customRequestOptions: RawRequestParams = {}): Promise { + return this.request( + Object.assign({ action: 'query' }, params), + customRequestOptions + ) as Promise; } /************** CORE FUNCTIONS *******************/