From 41299244b79324be7d59276d7eab004be3aecb73 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Sun, 21 May 2017 13:50:52 +0200 Subject: [PATCH] Allow InputFile to handle video notes --- telegram/inputfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/telegram/inputfile.py b/telegram/inputfile.py index e73115f79..de4aac011 100644 --- a/telegram/inputfile.py +++ b/telegram/inputfile.py @@ -35,7 +35,8 @@ from telegram import TelegramError DEFAULT_MIME_TYPE = 'application/octet-stream' USER_AGENT = 'Python Telegram Bot (https://github.com/python-telegram-bot/python-telegram-bot)' -FILE_TYPES = ('audio', 'document', 'photo', 'sticker', 'video', 'voice', 'certificate') +FILE_TYPES = ('audio', 'document', 'photo', 'sticker', 'video', 'voice', 'certificate', + 'video_note') class InputFile(object): @@ -66,6 +67,9 @@ class InputFile(object): elif 'certificate' in data: self.input_name = 'certificate' self.input_file = data.pop('certificate') + elif 'video_note' in data: + self.input_name = 'video_note' + self.input_file = data.pop('video_note') else: raise TelegramError('Unknown inputfile type') @@ -117,7 +121,7 @@ class InputFile(object): form_boundary, 'Content-Disposition: form-data; name="%s"' % name, '', str(value) ]) - # Add input_file to upload +# Add input_file to upload form.extend([ form_boundary, 'Content-Disposition: form-data; name="%s"; filename="%s"' % (self.input_name,