Search code examples
pythontelegrampyrogram

Telegram Python bot to upload media as video


I've been trying to make a Python-based Telegram bot that can read RSS feed and upload videos.

This is the code and it is working:

https://pastecode.io/s/jhydzq2w

However, bot is currently uploading videos as a attachment/file. How can modify the bot and upload it as a video (which has thumbnail)?


Solution

  • Use Client.send_video() methond

    here is docs: https://docs.pyrogram.org/api/methods/send_video

    replace sent_files.extend with Client.send_video().