Added method to extract message from update

This commit is contained in:
JosXa 2017-10-10 14:41:38 +02:00
parent a17def8026
commit 2d37bc6a91

View File

@ -42,6 +42,7 @@ def get_display_name(entity):
return '(unknown)'
# For some reason, .webp (stickers' format) is not registered
add_type('image/webp', '.webp')
@ -372,6 +373,14 @@ def find_user_or_chat(peer, users, chats):
pass
def find_message(update):
if update.message:
if update.message.message:
return update.message.message
return update.message
return None
def get_appropriated_part_size(file_size):
"""Gets the appropriated part size when uploading or downloading files,
given an initial file size"""