send document file #2297
Answered
by
RememberTheAir
rezakarbasi
asked this question in
Q&A
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
RememberTheAir
Jan 6, 2021
Replies: 1 comment
-
The wiki has a quite detailed chapter about working with files and medias: Working with files and media In short, to send a file from disk, you have to open it and pass the bytes object to the with open("some_file.txt", "rb") as f:
bot.send_document(chat_id, f) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Bibo-Joshi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The wiki has a quite detailed chapter about working with files and medias: Working with files and media
In short, to send a file from disk, you have to open it and pass the bytes object to the
Bot.send_document
method: