2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Directly pass the message instead of the update

This commit is contained in:
Dan 2018-04-06 20:35:38 +02:00
parent e98b209526
commit ede627de52

View File

@ -67,12 +67,16 @@ class Dispatcher:
def dispatch(self, update): def dispatch(self, update):
if update.message: if update.message:
key = MessageHandler key = MessageHandler
value = update.message
elif update.edited_message: elif update.edited_message:
key = EditedMessageHandler key = EditedMessageHandler
value = update.edited_message
elif update.channel_post: elif update.channel_post:
key = ChannelPostHandler key = ChannelPostHandler
value = update.channel_post
elif update.edited_channel_post: elif update.edited_channel_post:
key = EditedChannelPostHandler key = EditedChannelPostHandler
value = update.edited_channel_post
else: else:
return return
@ -80,7 +84,7 @@ class Dispatcher:
handler = group.get(key, None) handler = group.get(key, None)
if handler is not None: if handler is not None:
handler.callback(self.client, update) handler.callback(self.client, value)
def update_worker(self): def update_worker(self):
name = threading.current_thread().name name = threading.current_thread().name