Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chg: allow callback_query_handler to do not have func arg. #2345

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading