Closed AdonayVeiga closed 1 year ago
I also tried to
from telebot import types
send_document(message.chat.id, types.InputFile('path\to\file'))
but then I got an "AttributeError: module 'telebot.types' has no attribute 'InputFile'"
See the working example.
https://pytba.readthedocs.io/en/latest/types.html#telebot.types.InputFile
Are you sure you don't have wrong library(telebot) installed?
See the working example.
https://pytba.readthedocs.io/en/latest/types.html#telebot.types.InputFile
That is exactly the same example i'm try to run. Please check the link under telebot.types.InputFile in the first comment.
Are you sure you don't have wrong library(telebot) installed?
I'm pretty sure. I've installed library with pip install pyTelegramBotAPI
and here is the pip freeze
output:
certifi==2022.12.7 charset-normalizer==3.1.0 idna==3.4 numpy==1.24.3 pandas==2.0.1 pyTelegramBotAPI==4.11.0 python-dateutil==2.8.2 pytz==2023.3 requests==2.30.0 six==1.16.0 tzdata==2023.3 urllib3==2.0.2
I found what was wrong. I actually have an issue with my virtual enviroment. Sorry and thanks.
What version of pyTelegramBotAPI are you using? 4.11.0
What OS are you using? Windows
What version of python are you using? 3.9.4
Documentation says to use telebot.types.InputFile to upload a new file, but when I try to run provided example I get an "ImportError: cannot import name 'InputFile' from 'telebot.types'"
Am I doing it wrong? Documentation need update? Thanks in advance