diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index 53b150a..ba7f8ab 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -7,7 +7,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.1.8" +__version__ = "2.1.9" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/custombot.py b/davtelepot/custombot.py index 446d95b..f43f189 100644 --- a/davtelepot/custombot.py +++ b/davtelepot/custombot.py @@ -246,10 +246,15 @@ class Bot(davtelepot.bot.Bot): This method is deprecated: use `set_chosen_inline_result_handler` instead. """ + if not asyncio.iscoroutinefunction(func): + async def _func(update): + return func(update) + else: + _func = func return self.set_chosen_inline_result_handler( user_id=user_id, result_id=result_id, - handler=func + handler=_func ) async def handle_pinned_message(self, update, user_record=None):