1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Bugfix in answer_web_app_query

This commit is contained in:
Badiboy 2022-04-24 11:33:19 +03:00
parent bd002c6429
commit b43b636ba0
3 changed files with 5 additions and 6 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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')