JoJo_protection2020-03-14 23:59:16
JoJo_protection, 2020-03-14 23:59:16

After entering the command in the chat, the error "AttributeError: 'NoneType' object has no attribute 'from_user'" appears. How to fix it?

Good day. I'm still learning how to create bots in a telegram, I read the documentation but didn't understand everything, I'm thinking of turning here.

Well, to the topic:
Here is such an error.

Just in case, here is the bot code:
Well, it turns out that if you write in response to someone, then everything is fine, but if you just write a command (as shown in the screenshot), then this is the picture ...
Library: pytelegrambotapi

Answer the question

In order to leave comments, you need to log in

1 answer(s)
dimastbk, 2020-03-15

After all, it is logical that if a message is quoted, then message.reply_to_message will exist, and if not quoted, it will be None. The attribute names seem to speak for themselves.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question