Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Oct 1, 2021
1 parent ff35f25 commit f337abe
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2575,9 +2575,6 @@ def default_command(message):
if content_types is None:
content_types = ["text"]

if type(state) is not list and state is not None:
state = [state]

if isinstance(commands, str):
logger.warning("message_handler: 'commands' filter should be List of strings (commands), not string.")
commands = [commands]
Expand All @@ -2592,7 +2589,6 @@ def decorator(handler):
content_types=content_types,
commands=commands,
regexp=regexp,
state=state,
func=func,
**kwargs)
self.add_message_handler(handler_dict)
Expand All @@ -2608,7 +2604,7 @@ def add_message_handler(self, handler_dict):
"""
self.message_handlers.append(handler_dict)

def register_message_handler(self, callback, content_types=None, commands=None, regexp=None, func=None, chat_types=None, state=None, **kwargs):
def register_message_handler(self, callback, content_types=None, commands=None, regexp=None, func=None, chat_types=None, **kwargs):
"""
Registers message handler.
:param callback: function to be called
Expand All @@ -2632,7 +2628,6 @@ def register_message_handler(self, callback, content_types=None, commands=None,
content_types=content_types,
commands=commands,
regexp=regexp,
state=state,
func=func,
**kwargs)
self.add_message_handler(handler_dict)
Expand Down

0 comments on commit f337abe

Please sign in to comment.