mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
parent
429cfd0882
commit
392fea6e32
@ -130,34 +130,33 @@ class Dispatcher:
|
|||||||
|
|
||||||
parsed_update, handler_type = (
|
parsed_update, handler_type = (
|
||||||
parser(update, users, chats)
|
parser(update, users, chats)
|
||||||
if parser
|
if parser is not None
|
||||||
else (None, type)
|
else (None, type(None))
|
||||||
)
|
)
|
||||||
|
|
||||||
for group in self.groups.values():
|
for group in self.groups.values():
|
||||||
try:
|
|
||||||
for handler in group:
|
for handler in group:
|
||||||
args = None
|
args = None
|
||||||
|
|
||||||
if isinstance(handler, RawUpdateHandler):
|
if isinstance(handler, handler_type):
|
||||||
args = (update, users, chats)
|
|
||||||
elif isinstance(handler, handler_type):
|
|
||||||
if handler.check(parsed_update):
|
if handler.check(parsed_update):
|
||||||
args = (parsed_update,)
|
args = (parsed_update,)
|
||||||
|
elif isinstance(handler, RawUpdateHandler):
|
||||||
|
args = (update, users, chats)
|
||||||
|
|
||||||
if args is None:
|
if args is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
handler.callback(self.client, *args)
|
handler.callback(self.client, *args)
|
||||||
except StopIteration:
|
except pyrogram.StopPropagation:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
break
|
break
|
||||||
except StopIteration:
|
except pyrogram.StopPropagation:
|
||||||
break
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user