mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-27 08:19:47 +03:00
Add Button.web_view()
In theory, it should open links inside the telegram app rather than opening another browser. Please advise if this is not necessary
This commit is contained in:
parent
47673680f4
commit
003c6f6626
|
@ -307,3 +307,14 @@ class Button:
|
|||
documentation for more information on using games.
|
||||
"""
|
||||
return types.KeyboardButtonGame(text)
|
||||
|
||||
@staticmethod
|
||||
def web_view(text, url=None):
|
||||
"""
|
||||
Creates a new inline button to open the desired URL in a WebView.
|
||||
If no `url` is given, the `text` will be used as the URL instead.
|
||||
You cannot detect that the user clicked this button directly.
|
||||
When the user clicks this button, the URL will open in the Telegram
|
||||
app's WebView directly.
|
||||
"""
|
||||
return types.KeyboardButtonWebView(text, url or text)
|
||||
|
|
Loading…
Reference in New Issue
Block a user