D
D
Demorfly2020-10-30 22:19:47
Python
Demorfly, 2020-10-30 22:19:47

Why doesn't this work in python vk.api?

if event.from_chat or event.from_user:
                if event.object.text.lower().split(' ')[0] == 'find':
                    print('начат поиск')
                    event.object.text.lower().split(' ')[1] = findingelement


"find Text" is written in the group chat, data is loaded from the file and searched in the code above by the variable findingelement.
An error is generated AttributeError: 'NoneType' object has no attribute 'lower'

In fact, I need a second text variable, please help me how to extract it from the message.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question