mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 12:10:21 +03:00
Added method to extract message from update
This commit is contained in:
parent
a17def8026
commit
2d37bc6a91
|
@ -42,6 +42,7 @@ def get_display_name(entity):
|
||||||
|
|
||||||
return '(unknown)'
|
return '(unknown)'
|
||||||
|
|
||||||
|
|
||||||
# For some reason, .webp (stickers' format) is not registered
|
# For some reason, .webp (stickers' format) is not registered
|
||||||
add_type('image/webp', '.webp')
|
add_type('image/webp', '.webp')
|
||||||
|
|
||||||
|
@ -372,6 +373,14 @@ def find_user_or_chat(peer, users, chats):
|
||||||
pass
|
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):
|
def get_appropriated_part_size(file_size):
|
||||||
"""Gets the appropriated part size when uploading or downloading files,
|
"""Gets the appropriated part size when uploading or downloading files,
|
||||||
given an initial file size"""
|
given an initial file size"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user