mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
improve code quality
This commit is contained in:
parent
30aaf8d0f1
commit
4798c26188
@ -6080,11 +6080,13 @@ class TeleBot:
|
||||
for handler in handlers:
|
||||
if self._test_message_handler(handler, message):
|
||||
if handler.get('pass_bot', False):
|
||||
handler['function'](message, bot = self)
|
||||
result = handler['function'](message, bot=self)
|
||||
else:
|
||||
handler['function'](message)
|
||||
result = handler['function'](message)
|
||||
if not isinstance(result, ContinueHandling):
|
||||
break
|
||||
else:
|
||||
return
|
||||
|
||||
data = {}
|
||||
params =[]
|
||||
handler_error = None
|
||||
@ -6107,7 +6109,7 @@ class TeleBot:
|
||||
elif isinstance(result, SkipHandler):
|
||||
skip_handlers = True
|
||||
|
||||
if handlers and not(skip_handlers):
|
||||
if handlers and not skip_handlers:
|
||||
try:
|
||||
for handler in handlers:
|
||||
process_handler = self._test_message_handler(handler, message)
|
||||
|
@ -249,6 +249,8 @@ class SkipHandler:
|
||||
Update will go to post_process,
|
||||
but will skip execution of handler.
|
||||
"""
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
class CancelUpdate:
|
||||
@ -259,6 +261,9 @@ class CancelUpdate:
|
||||
Update will skip handler and execution
|
||||
of post_process in middlewares.
|
||||
"""
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
class ContinueHandling:
|
||||
"""
|
||||
@ -266,3 +271,6 @@ class ContinueHandling:
|
||||
Just return instance of this class
|
||||
in handlers to continue process.
|
||||
"""
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user