Check empty messages first of all

This commit is contained in:
Dan 2021-12-07 20:29:46 +01:00
parent 8d03850d03
commit e2cce1b1e6

View File

@ -433,6 +433,9 @@ class Message(Object, Update):
is_scheduled: bool = False, is_scheduled: bool = False,
replies: int = 1 replies: int = 1
): ):
if isinstance(message, raw.types.MessageEmpty):
return Message(message_id=message.id, empty=True, client=client)
user_id = utils.get_raw_peer_id(message.from_id) or utils.get_raw_peer_id(message.peer_id) user_id = utils.get_raw_peer_id(message.from_id) or utils.get_raw_peer_id(message.peer_id)
if user_id not in users: if user_id not in users:
try: try:
@ -446,9 +449,6 @@ class Message(Object, Update):
else: else:
users[r.id] = r users[r.id] = r
if isinstance(message, raw.types.MessageEmpty):
return Message(message_id=message.id, empty=True, client=client)
if isinstance(message, raw.types.MessageService): if isinstance(message, raw.types.MessageService):
action = message.action action = message.action