mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-24 07:51:44 +00:00
Add the method answer_web_app_query
This commit is contained in:
parent
747b25b9eb
commit
43f9b57567
@ -299,6 +299,7 @@ def pyrogram_api():
|
|||||||
get_bot_default_privileges
|
get_bot_default_privileges
|
||||||
set_chat_menu_button
|
set_chat_menu_button
|
||||||
get_chat_menu_button
|
get_chat_menu_button
|
||||||
|
answer_web_app_query
|
||||||
""",
|
""",
|
||||||
authorization="""
|
authorization="""
|
||||||
Authorization
|
Authorization
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
from .answer_callback_query import AnswerCallbackQuery
|
from .answer_callback_query import AnswerCallbackQuery
|
||||||
from .answer_inline_query import AnswerInlineQuery
|
from .answer_inline_query import AnswerInlineQuery
|
||||||
|
from .answer_web_app_query import AnswerWebAppQuery
|
||||||
from .delete_bot_commands import DeleteBotCommands
|
from .delete_bot_commands import DeleteBotCommands
|
||||||
from .get_bot_commands import GetBotCommands
|
from .get_bot_commands import GetBotCommands
|
||||||
from .get_bot_default_privileges import GetBotDefaultPrivileges
|
from .get_bot_default_privileges import GetBotDefaultPrivileges
|
||||||
@ -48,6 +49,7 @@ class Bots(
|
|||||||
SetBotDefaultPrivileges,
|
SetBotDefaultPrivileges,
|
||||||
GetBotDefaultPrivileges,
|
GetBotDefaultPrivileges,
|
||||||
SetChatMenuButton,
|
SetChatMenuButton,
|
||||||
GetChatMenuButton
|
GetChatMenuButton,
|
||||||
|
AnswerWebAppQuery
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
51
pyrogram/methods/bots/answer_web_app_query.py
Normal file
51
pyrogram/methods/bots/answer_web_app_query.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||||
|
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
|
||||||
|
#
|
||||||
|
# This file is part of Pyrogram.
|
||||||
|
#
|
||||||
|
# Pyrogram is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Lesser General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Pyrogram is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import pyrogram
|
||||||
|
from pyrogram import raw
|
||||||
|
from pyrogram import types
|
||||||
|
|
||||||
|
|
||||||
|
class AnswerWebAppQuery:
|
||||||
|
async def answer_web_app_query(
|
||||||
|
self: "pyrogram.Client",
|
||||||
|
web_app_query_id: str,
|
||||||
|
result: "types.InlineQueryResult"
|
||||||
|
) -> "types.SentWebAppMessage":
|
||||||
|
"""Set the result of an interaction with a `Web App <https://core.telegram.org/bots/webapps>`_ and send a
|
||||||
|
corresponding message on behalf of the user to the chat from which the query originated.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
web_app_query_id (``str``):
|
||||||
|
Unique identifier for the answered query.
|
||||||
|
|
||||||
|
result (:obj:`~pyrogram.types.InlineQueryResult`):
|
||||||
|
A list of results for the inline query.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
:obj:`~pyrogram.types.SentWebAppMessage`: On success the sent web app message is returned.
|
||||||
|
"""
|
||||||
|
|
||||||
|
r = await self.invoke(
|
||||||
|
raw.functions.messages.SendWebViewResultMessage(
|
||||||
|
bot_query_id=web_app_query_id,
|
||||||
|
result=await result.write(self)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return types.SentWebAppMessage._parse(r)
|
Loading…
Reference in New Issue
Block a user