Skip to content

Commit 747b25b

Browse files
committed
Add the class SentWebAppMessage
1 parent 91e4716 commit 747b25b

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

compiler/docs/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ def get_title_list(s: str) -> list:
426426
MenuButtonCommands
427427
MenuButtonWebApp
428428
MenuButtonDefault
429+
SentWebAppMessage
429430
""",
430431
bot_commands="""
431432
Bot commands
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
from pyrogram import raw, utils
20+
from ..object import Object
21+
22+
23+
class SentWebAppMessage(Object):
24+
"""Contains information about an inline message sent by a `Web App <https://core.telegram.org/bots/webapps>`_ on behalf of a user.
25+
26+
Parameters:
27+
inline_message_id (``str``):
28+
Identifier of the sent inline message.
29+
Available only if there is an inline keyboard attached to the message.
30+
"""
31+
32+
def __init__(
33+
self, *,
34+
inline_message_id: str,
35+
):
36+
super().__init__()
37+
38+
self.inline_message_id = inline_message_id
39+
40+
@staticmethod
41+
def _parse(obj: "raw.types.WebViewMessageSent"):
42+
return SentWebAppMessage(inline_message_id=utils.pack_inline_message_id(obj.msg_id))

0 commit comments

Comments
 (0)