From c901c75b468c3cbefa6bd2e486c73487c2ce8803 Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Thu, 11 Jul 2024 23:38:53 +0000 Subject: [PATCH] chg: allow callback_query_handler to do not have func arg. --- telebot/__init__.py | 2 +- telebot/async_telebot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 630edb29e..b154d04ca 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -7700,7 +7700,7 @@ def register_chosen_inline_handler(self, callback: Callable, func: Callable, pas self.add_chosen_inline_handler(handler_dict) - def callback_query_handler(self, func, **kwargs): + def callback_query_handler(self, func=None, **kwargs): """ Handles new incoming callback query. As a parameter to the decorator function, it passes :class:`telebot.types.CallbackQuery` object. diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index d8dd91e05..d50cbf7e0 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -1700,7 +1700,7 @@ def register_chosen_inline_handler(self, callback: Callable[[Any], Awaitable], f handler_dict = self._build_handler_dict(callback, func=func, pass_bot=pass_bot, **kwargs) self.add_chosen_inline_handler(handler_dict) - def callback_query_handler(self, func, **kwargs): + def callback_query_handler(self, func=None, **kwargs): """ Handles new incoming callback query. As a parameter to the decorator function, it passes :class:`telebot.types.CallbackQuery` object.