mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-15 20:02:22 +00:00
Add send video
This commit is contained in:
parent
f399232ea6
commit
321bd68b5a
2 changed files with 15 additions and 3 deletions
|
|
@ -95,7 +95,7 @@ class ApiMethods:
|
|||
SEND_AUDIO = 'sendAudio'
|
||||
SEND_DOCUMENT = 'sendDocument'
|
||||
SEND_STICKER = 'sendSticker'
|
||||
SEND_VIDEO = 'sendVideo' # TODO
|
||||
SEND_VIDEO = 'sendVideo'
|
||||
SEND_VOICE = 'sendVoice' # TODO
|
||||
SEND_VIDEO_NOTE = 'sendVideoNote' # TODO
|
||||
SEND_LOCATION = 'sendLocation' # TODO
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class AIOGramBot:
|
|||
if hasattr(reply_to_message_id, 'message_id'):
|
||||
reply_to_message_id = reply_to_message_id.message_id
|
||||
|
||||
payload = generate_payload(**locals(), exclude=['document'])
|
||||
payload = generate_payload(**locals(), exclude=[_METHOD])
|
||||
return await self._send_file(_METHOD, document, payload)
|
||||
|
||||
async def send_sticker(self, chat_id, sticker, disable_notification=None, reply_to_message_id=None,
|
||||
|
|
@ -180,5 +180,17 @@ class AIOGramBot:
|
|||
if hasattr(reply_to_message_id, 'message_id'):
|
||||
reply_to_message_id = reply_to_message_id.message_id
|
||||
|
||||
payload = generate_payload(**locals(), exclude=['sticker'])
|
||||
payload = generate_payload(**locals(), exclude=[_METHOD])
|
||||
return await self._send_file(_METHOD, sticker, payload)
|
||||
|
||||
async def send_video(self, chat_id, video, duration=None, width=None, height=None, caption=None,
|
||||
disable_notification=None, reply_to_message_id=None, reply_markup=None) -> Message:
|
||||
_METHOD = 'video'
|
||||
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=['video'])
|
||||
return await self._send_file(_METHOD, video, payload)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue