S
S
Stepan Sidorov2020-12-18 19:58:43
Python
Stepan Sidorov, 2020-12-18 19:58:43

Why does the telegram bot not accept/see video messages?

I need to get and save a video from a user.
I have set all possible message types

message_handler(func=lambda message: True, content_types=['audio', 'photo', 'voice', 'video', 'document', 'text', 'location', 'contact', 'sticker'])
.
But when I record a video for the bot, it doesn't respond.
Maybe you need to tweak some settings in the bot, or use a different decorator?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-12-18
@always-prog

Do you mean that you are recording a video message through the built-in button? Then this is VideoNote
https://core.telegram.org/bots/api#videonote
For telebot respectivelyvideo_note

S
SashaN69, 2020-12-18
@SashaN69

@dp.message_handler()
async def echo_message(msg: types.Message):
    await bot.send_message(msg.from_user.id, msg.text)


@dp.message_handler(content_types=ContentType.ANY)
async def unknown_message(msg: types.Message):
    message_text = text(emojize('Я не знаю, что с этим делать :astonished:'),
                        italic('\nЯ просто напомню,'), 'что есть',
                        code('команда'), '/help')
    await msg.reply(message_text, parse_mode=ParseMode.MARKDOWN)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question