Add send video note

This commit is contained in:
Alex Root Junior 2017-05-30 23:05:33 +03:00
parent 858466810c
commit c5ee2fe4b2
2 changed files with 13 additions and 1 deletions

View file

@ -97,7 +97,7 @@ class ApiMethods:
SEND_STICKER = 'sendSticker'
SEND_VIDEO = 'sendVideo'
SEND_VOICE = 'sendVoice'
SEND_VIDEO_NOTE = 'sendVideoNote' # TODO
SEND_VIDEO_NOTE = 'sendVideoNote'
SEND_LOCATION = 'sendLocation' # TODO
SEND_VENUE = 'sendVenue' # TODO
SEND_CONTACT = 'sendContact' # TODO

View file

@ -206,3 +206,15 @@ class AIOGramBot:
payload = generate_payload(**locals(), exclude=[_message_type])
return await self._send_file(_message_type, voice, payload)
async def send_video_note(self, chat_id, video_note, duration=None, length=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None) -> Message:
_message_type = 'video_note'
if reply_markup and hasattr(reply_markup, 'to_json'):
reply_markup = json.dumps(reply_markup.to_json())
if hasattr(reply_to_message_id, 'message_id'):
reply_to_message_id = reply_to_message_id.message_id
payload = generate_payload(**locals(), exclude=[_message_type])
return await self._send_file(_message_type, video_note, payload)