diff --git a/readthedocs/misc/v2-migration-guide.rst b/readthedocs/misc/v2-migration-guide.rst index 96ef3b6e..42285c1d 100644 --- a/readthedocs/misc/v2-migration-guide.rst +++ b/readthedocs/misc/v2-migration-guide.rst @@ -701,6 +701,12 @@ CdnDecrypter has been removed It was not really working and was more intended to be an implementation detail than anything else. +URL buttons no longer open the web-browser +------------------------------------------ + +Now the URL is returned. You can still use ``webbrowser.open`` to get the old behaviour. + + --- you can no longer pass an attributes list because the constructor is now nice. diff --git a/telethon/types/_custom/messagebutton.py b/telethon/types/_custom/messagebutton.py index c821c410..2d588727 100644 --- a/telethon/types/_custom/messagebutton.py +++ b/telethon/types/_custom/messagebutton.py @@ -112,7 +112,7 @@ class MessageButton: bot=self._bot, peer=self._chat, start_param=self.button.query )) elif isinstance(self.button, _tl.KeyboardButtonUrl): - return webbrowser.open(self.button.url) + return self.button.url elif isinstance(self.button, _tl.KeyboardButtonGame): req = _tl.fn.messages.GetBotCallbackAnswer( peer=self._chat, msg_id=self._msg_id, game=True