When answering inline queries, prevent invalid InlineQueryResultsButton instantiation
This commit is contained in:
parent
51a77c695b
commit
eab81b065d
@ -11,7 +11,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.9.3"
|
||||
__version__ = "2.9.4"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@ -1768,9 +1768,9 @@ class TelegramBot:
|
||||
No more than 50 results per query are allowed.
|
||||
See https://core.telegram.org/bots/api#answerinlinequery for details.
|
||||
"""
|
||||
if 'switch_pm_text' in kwargs:
|
||||
if 'switch_pm_text' in kwargs and kwargs['switch_pm_text']:
|
||||
button = InlineQueryResultsButton(text=kwargs['switch_pm_text'])
|
||||
if 'switch_pm_parameter' in kwargs:
|
||||
if 'switch_pm_parameter' in kwargs and kwargs['switch_pm_parameter']:
|
||||
button = InlineQueryResultsButton(start_parameter=kwargs['switch_pm_parameter'])
|
||||
return await self.api_request(
|
||||
'answerInlineQuery',
|
||||
|
Loading…
x
Reference in New Issue
Block a user