Skip to content

Commit

Permalink
Merge pull request #2345 from hiddify-com/remove_positonal_arg
Browse files Browse the repository at this point in the history
chg: allow callback_query_handler to do not have func arg.
  • Loading branch information
Badiboy authored Jul 17, 2024
2 parents e97e33e + c901c75 commit f91c618
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 f91c618

Please sign in to comment.