mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Making first condition shorter, no change in functionality
This commit is contained in:
parent
68095ad69a
commit
9075430210
@ -2783,7 +2783,7 @@ class TeleBot:
|
|||||||
if content_types is None:
|
if content_types is None:
|
||||||
content_types = ["text"]
|
content_types = ["text"]
|
||||||
|
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -2840,7 +2840,7 @@ class TeleBot:
|
|||||||
:param pass_bot: Pass TeleBot to handler.
|
:param pass_bot: Pass TeleBot to handler.
|
||||||
:return: decorated function
|
:return: decorated function
|
||||||
"""
|
"""
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -2888,7 +2888,7 @@ class TeleBot:
|
|||||||
if content_types is None:
|
if content_types is None:
|
||||||
content_types = ["text"]
|
content_types = ["text"]
|
||||||
|
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -2945,7 +2945,7 @@ class TeleBot:
|
|||||||
:param pass_bot: Pass TeleBot to handler.
|
:param pass_bot: Pass TeleBot to handler.
|
||||||
:return: decorated function
|
:return: decorated function
|
||||||
"""
|
"""
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -2993,7 +2993,7 @@ class TeleBot:
|
|||||||
if content_types is None:
|
if content_types is None:
|
||||||
content_types = ["text"]
|
content_types = ["text"]
|
||||||
|
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -3048,7 +3048,7 @@ class TeleBot:
|
|||||||
:param pass_bot: Pass TeleBot to handler.
|
:param pass_bot: Pass TeleBot to handler.
|
||||||
:return: decorated function
|
:return: decorated function
|
||||||
"""
|
"""
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -3094,7 +3094,7 @@ class TeleBot:
|
|||||||
if content_types is None:
|
if content_types is None:
|
||||||
content_types = ["text"]
|
content_types = ["text"]
|
||||||
|
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
@ -3149,7 +3149,7 @@ class TeleBot:
|
|||||||
:param pass_bot: Pass TeleBot to handler.
|
:param pass_bot: Pass TeleBot to handler.
|
||||||
:return: decorated function
|
:return: decorated function
|
||||||
"""
|
"""
|
||||||
if isinstance(commands, list) or isinstance(commands, set) or isinstance(commands, tuple):
|
if isinstance(commands, (list, set, tuple)):
|
||||||
if any(not isinstance(item, (str, int, float)) for item in commands):
|
if any(not isinstance(item, (str, int, float)) for item in commands):
|
||||||
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
logger.warning("message_handler: commands' filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use.")
|
||||||
elif all(isinstance(item, str) for item in commands):
|
elif all(isinstance(item, str) for item in commands):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user