Allow sending multiple files as album (closes #455)

This commit is contained in:
Lonami Exo
2018-01-15 18:15:30 +01:00
parent 494c90af69
commit 36e2101910
2 changed files with 87 additions and 22 deletions

View File

@@ -312,6 +312,12 @@ def get_input_media(media, user_caption=None, is_photo=False):
_raise_cast_fail(media, 'InputMedia')
def is_image(file):
"""Returns True if the file extension looks like an image file"""
return (isinstance(file, str) and
bool(re.search(r'\.(png|jpe?g|gif)$', file, re.IGNORECASE)))
def parse_phone(phone):
"""Parses the given phone, or returns None if it's invalid"""
if isinstance(phone, int):