From b43b636ba0b757743ea791d4d533c2c95d54eec7 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Sun, 24 Apr 2022 11:33:19 +0300 Subject: [PATCH] Bugfix in answer_web_app_query --- telebot/apihelper.py | 5 +++-- telebot/async_telebot.py | 2 -- telebot/asyncio_helper.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 55d6dbb..8d4b2f7 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -1615,12 +1615,13 @@ def delete_sticker_from_set(token, sticker): payload = {'sticker': sticker} return _make_request(token, method_url, params=payload, method='post') + def answer_web_app_query(token, web_app_query_id, result: types.InlineQueryResultBase): method_url = 'answerWebAppQuery' - result = result.to_json() - payload = {'query_id': web_app_query_id, 'result': result} + payload = {'web_app_query_id': web_app_query_id, 'result': result.to_json()} return _make_request(token, method_url, params=payload, method='post') + # noinspection PyShadowingBuiltins def send_poll( token, chat_id, diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index fedad40..f6d8cc4 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -1580,8 +1580,6 @@ class AsyncTeleBot: result = await asyncio_helper.get_chat_member(self.token, chat_id, user_id) return types.ChatMember.de_json(result) - - async def send_message( self, chat_id: Union[int, str], text: str, parse_mode: Optional[str]=None, diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index 40a4ca9..be6223b 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -353,10 +353,10 @@ async def delete_chat_sticker_set(token, chat_id): payload = {'chat_id': chat_id} return await _process_request(token, method_url, params=payload) + async def answer_web_app_query(token, web_app_query_id, result: types.InlineQueryResultBase): method_url = 'answerWebAppQuery' - result = result.to_json() - payload = {'query_id': web_app_query_id, 'result': result} + payload = {'web_app_query_id': web_app_query_id, 'result': result.to_json()} return await _process_request(token, method_url, params=payload, method='post')