Skip to content

Commit

Permalink
chg: allow callback_query_handler to do not have func arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jul 11, 2024
1 parent e97e33e commit c901c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c901c75

Please sign in to comment.