How to send a video via a telegram bot

How do I send a video via a telegram bot? here is a sample code, but it doesn't work

 elif message.text.lower() == 'example':
        keyboard = types.InlineKeyboardMarkup(row_width=3)
        keyboard = telebot.types.ReplyKeyboardMarkup(True)
        keyboard.row('example')
        bot.send_video(message.chat.id, 'http://example.com/video.mp4')
Author: Anonim, 2020-06-25

1 answers

First you need to open it

video = open('video.mp4', 'rb')
bot.send_video(message.chat.id, video)

You can read more here https://github.com/eternnoir/pyTelegramBotAPI

 0
Author: meaqese, 2020-06-25 13:32:44