Comments (4)
Simply provide a string instead of an actual file.
bot.send_sticker(chat_id, "<SOME_ID>")
from pytelegrambotapi.
Simply provide a string instead of an actual file.
bot.send_sticker(chat_id, "<SOME_ID>")
I get an error:
user@server:~$ python3 fdsfds.py
2019-07-03 03:41:20,925 (util.py:65 WorkerThread1) ERROR - TeleBot: "AttributeError occurred, args=("'TeleBot' object has no attribute 'photo'",)
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/telebot/util.py", line 59, in run
task(*args, **kwargs)
File "fdsfds.py", line 43, in photo
bot.photo(message.from_user.id, "AgADAgADbqsxG7kKcUi_CjymHgiEtX_Utw8ABNTJB6A9-S3OhCcAAgI")
AttributeError: 'TeleBot' object has no attribute 'photo'
"
Traceback (most recent call last):
File "fdsfds.py", line 50, in <module>
bot.polling(none_stop = True)
File "/usr/local/lib/python3.5/dist-packages/telebot/__init__.py", line 389, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/usr/local/lib/python3.5/dist-packages/telebot/__init__.py", line 413, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/usr/local/lib/python3.5/dist-packages/telebot/util.py", line 108, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/usr/lib/python3/dist-packages/six.py", line 686, in reraise
raise value
File "/usr/local/lib/python3.5/dist-packages/telebot/util.py", line 59, in run
task(*args, **kwargs)
File "fdsfds.py", line 43, in photo
bot.photo(message.from_user.id, "AgADAgADbqsxG7kKcUi_CjymHgiEtX_Utw8ABNTJB6A9-S3OhCcAAgI")
AttributeError: 'TeleBot' object has no attribute 'photo'
Even if you add <>, nothing changes.
from pytelegrambotapi.
bot.photo(message.from_user.id, ...)
Lol, you got AttributeError: 'TeleBot' object has no attribute 'photo' because... 'TeleBot' object has no attribute 'photo'.
Even if you take a look on the main page (https://github.com/eternnoir/pyTelegramBotAPI) and search for the word "photo" you'll see...
# All send_xyz functions which can take a file as an argument, can also take a file_id instead of a file.
# sendPhoto
photo = open('/tmp/photo.png', 'rb')
tb.send_photo(chat_id, photo)
tb.send_photo(chat_id, "FILEID")
from pytelegrambotapi.
Apparently I accidentally deleted the "send_". Here is what I am trying to send:
if message.text == "Hello":
bot.send_message(message.from_user.id, "Hello!")
bot.send_video(message.from_user.id, "BAADAgADRAMAAvlk-Ejjn4i0OUcDewI")
It produces error 400.
from pytelegrambotapi.
Related Issues (20)
- Wheel errors HOT 3
- An unmasked bot token is registered in the exclusion of connection to the Telegram API HOT 1
- Bot
- Globally set parse_mode doesn't apply to InputMedia class HOT 2
- Enable tracemalloc to get the object allocation traceback HOT 2
- inline_example HOT 8
- Where should I put apihelper.API_URL and when do I need to bot.log_out() HOT 34
- Problem when using `bot.retrieve_data` HOT 4
- Missing type hints in SimpleCustomFilter HOT 2
- Why there is problem? HOT 1
- Bot API update 7.3 HOT 5
- how do i respond to messages from business_message_handler? HOT 1
- how would i implement a repeat send command HOT 1
- Send message into channel or chat
- bot.copy_message() doesn't add reply_markup to messages HOT 1
- Check bot blocked exception HOT 1
- Unresolved attribute reference 'delete_chat_history' for class 'TeleBot' HOT 1
- @alv095
- I can't handle the exception telebot.apihelper.apitelgramexception HOT 1
- Issue with not defined type HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytelegrambotapi.