Answer the question
In order to leave comments, you need to log in
Bot in telegram, error when clicking, who can help?
2020-06-03 17:42:38,141 (util.py:66 WorkerThread2) ERROR - TeleBot: "AttributeError occurred, args=("type object 'Product' has no attribute 'id'",)
Traceback (most recent call last):
File "C:\Users\DINEX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\util.py", line 60, in run
task(*args, **kwargs)
File "C:/Users/DINEX/PycharmProjects/TELEGRAMbot/rec2020.py", line 1627, in callbackHandler
bot.handleCallback(call)
File "C:/Users/DINEX/PycharmProjects/TELEGRAMbot/rec2020.py", line 543, in handleCallback
func(msg, self.__getBtnTextFromCallback(msg), self.__getBtnIdFromCallback(msg))
File "C:/Users/DINEX/PycharmProjects/TELEGRAMbot/rec2020.py", line 664, in __handleCHOOSE_REGION
self.__createOrder(userId)
File "C:/Users/DINEX/PycharmProjects/TELEGRAMbot/rec2020.py", line 1295, in __createOrder
self._Memories[userId].Product.id,
AttributeError: type object 'Product' has no attribute 'id'
Answer the question
In order to leave comments, you need to log in
The Product object does not have an id attribute)
As an option, wrap the problematic place in a try...except
Well, without code, it's hard to say.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question