update deps, add support for video notes

This commit is contained in:
Tomáš Mládek 2018-10-02 13:36:23 +02:00 committed by Tomáš Mládek
parent 6a0dc0b00b
commit ab45dccb01
2 changed files with 18 additions and 8 deletions

View file

@ -168,8 +168,11 @@ def handle_rest(bot, update):
file = update.message.audio.file_id file = update.message.audio.file_id
elif update.message.video is not None: elif update.message.video is not None:
file = update.message.video.file_id file = update.message.video.file_id
elif update.message.video_note is not None:
file = update.message.video_note.file_id
elif update.message.voice is not None: elif update.message.voice is not None:
file = update.message.voice.file_id file = update.message.voice.file_id
if file is not None: if file is not None:
url = bot.getFile(file).file_path url = bot.getFile(file).file_path
handle([url], update.message, download_raw, filename=filename) handle([url], update.message, download_raw, filename=filename)
@ -201,7 +204,9 @@ def main():
dp.add_handler(MessageHandler(Filters.entity(MessageEntity.URL), handle_url)) dp.add_handler(MessageHandler(Filters.entity(MessageEntity.URL), handle_url))
dp.add_handler( dp.add_handler(
MessageHandler(Filters.photo | Filters.video | Filters.audio | Filters.voice | Filters.document, handle_rest)) MessageHandler(
Filters.photo | Filters.video | Filters.video_note | Filters.audio | Filters.voice | Filters.document,
handle_rest))
dp.add_handler(MessageHandler(Filters.entity(MessageEntity.HASHTAG), handle_hashtag)) dp.add_handler(MessageHandler(Filters.entity(MessageEntity.HASHTAG), handle_hashtag))
updater.start_polling() updater.start_polling()

View file

@ -4,12 +4,17 @@
# #
# pip-compile --output-file requirements.txt requirements.in # pip-compile --output-file requirements.txt requirements.in
# #
certifi==2018.1.18 # via python-telegram-bot, requests asn1crypto==0.24.0 # via cryptography
certifi==2018.8.24 # via python-telegram-bot, requests
cffi==1.11.5 # via cryptography
chardet==3.0.4 # via requests chardet==3.0.4 # via requests
filetype==1.0.0 cryptography==2.3.1 # via python-telegram-bot
filetype==1.0.1
future==0.16.0 # via python-telegram-bot future==0.16.0 # via python-telegram-bot
idna==2.6 # via requests idna==2.7 # via cryptography, requests
python-telegram-bot==9.0.0 pycparser==2.19 # via cffi
requests==2.18.4 python-telegram-bot==11.1.0
urllib3==1.22 # via requests requests==2.19.1
youtube-dl==2018.1.27 six==1.11.0 # via cryptography
urllib3==1.23 # via requests
youtube-dl==2018.9.26