From ede627de52536aa961473bf32928bca13b86dca8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 6 Apr 2018 20:35:38 +0200 Subject: [PATCH] Directly pass the message instead of the update --- pyrogram/client/dispatcher/dispatcher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/dispatcher/dispatcher.py b/pyrogram/client/dispatcher/dispatcher.py index 035e2aff..1584740d 100644 --- a/pyrogram/client/dispatcher/dispatcher.py +++ b/pyrogram/client/dispatcher/dispatcher.py @@ -67,12 +67,16 @@ class Dispatcher: def dispatch(self, update): if update.message: key = MessageHandler + value = update.message elif update.edited_message: key = EditedMessageHandler + value = update.edited_message elif update.channel_post: key = ChannelPostHandler + value = update.channel_post elif update.edited_channel_post: key = EditedChannelPostHandler + value = update.edited_channel_post else: return @@ -80,7 +84,7 @@ class Dispatcher: handler = group.get(key, None) if handler is not None: - handler.callback(self.client, update) + handler.callback(self.client, value) def update_worker(self): name = threading.current_thread().name