Quantcast
Viewing all articles
Browse latest Browse all 14215

I'm trying to run a Python code that sends a file to a Telegram bot [closed]

:11: RuntimeWarning: coroutine 'Bot.send_document' was never awaited

RuntimeWarning: Enable tracemalloc to get the object allocation traceback

[Program finished]

"python"

from telegram import Bot

bot_token = '5945984065:AAERsXuP4rk6sYUuIOdvuLHLuy7IL9rSeQA'

bot = Bot(token=bot_token)

chat_id = '563748652'

file_path = '/storage/emulated/0/Download/B70FMgkIIAAE2LN.jpg'

bot.send_document(chat_id=chat_id, document=open(file_path, 'rb'))


Viewing all articles
Browse latest Browse all 14215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>