Support URLs on send_file

This commit is contained in:
Lonami Exo
2018-06-26 16:39:22 +02:00
parent 2b090f8888
commit 2bd0c6c525
2 changed files with 25 additions and 6 deletions

View File

@@ -510,6 +510,13 @@ def is_image(file):
return re.match(r'\.(png|jpe?g)', _get_extension(file), re.IGNORECASE)
def is_gif(file):
"""
Returns ``True`` if the file extension looks like a gif file to Telegram.
"""
return re.match(r'\.gif', _get_extension(file), re.IGNORECASE)
def is_audio(file):
"""Returns ``True`` if the file extension looks like an audio file."""
file = 'a' + _get_extension(file)