Fix get_message_id after custom message patch

This commit is contained in:
Lonami 2018-07-29 15:49:12 +02:00 committed by GitHub
parent 96742334a4
commit 223b007a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,16 +396,13 @@ def get_input_message(message):
def get_message_id(message): def get_message_id(message):
"""Sanitizes the 'reply_to' parameter a user may send""" """Similar to :meth:`get_input_peer`, but for message IDs."""
if message is None: if message is None:
return None return None
if isinstance(message, int): if isinstance(message, int):
return message return message
if hasattr(message, 'original_message'):
return message.original_message.id
try: try:
if message.SUBCLASS_OF_ID == 0x790009e3: if message.SUBCLASS_OF_ID == 0x790009e3:
# hex(crc32(b'Message')) = 0x790009e3 # hex(crc32(b'Message')) = 0x790009e3