mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-15 20:02:22 +00:00
Add send video note
This commit is contained in:
parent
858466810c
commit
c5ee2fe4b2
2 changed files with 13 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue