Answer the question
In order to leave comments, you need to log in
Sending video to aiogram in python?
Hello, I want to send a video through the bot, but it doesn’t work.
The bot is written on the aiogram library.
Here is the code:
@dp.message_handler(commands=['test'])
async def cmd_image(message: types.Message):
await message.answer_video('/storage/emulated/0/Movies/3e36b80b873e29689147792373da5934.mp4')
Answer the question
In order to leave comments, you need to log in
Try like this:
@dp.message_handler(commands=['test'])
async def cmd_image(message: types.Message):
with open('/storage/emulated/0/Movies/3e36b80b873e29689147792373da5934.mp4', 'rb') as video:
await message.answer_video(video)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question