From 0dd5ebef804f4f499ddb2aea7ea4353e49585cec Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 14 Apr 2018 16:59:34 +0200 Subject: [PATCH] Fix raw update handler throwing errors --- pyrogram/client/dispatcher/dispatcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/dispatcher/dispatcher.py b/pyrogram/client/dispatcher/dispatcher.py index ac61b04f..72bcbfc9 100644 --- a/pyrogram/client/dispatcher/dispatcher.py +++ b/pyrogram/client/dispatcher/dispatcher.py @@ -25,7 +25,7 @@ from threading import Thread import pyrogram from pyrogram.api import types from .. import message_parser -from ..handlers import RawUpdateHandler +from ..handlers import RawUpdateHandler, MessageHandler log = logging.getLogger(__name__) @@ -84,6 +84,9 @@ class Dispatcher: args = (self.client, update, users, chats) else: + if not isinstance(handler, MessageHandler): + continue + message = (update.message or update.channel_post or update.edited_message