from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
import vk_api
token = 'токен'
vk = vk_api.VkApi(token=token)
vk._auth_token()
vk.get_api()
longpoll = VkBotLongPoll(vk, id)
while True:
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.object.peer_id == event.object.from_id:
if event.object.text.lower() == 'слово':
vk.messages.sent(message='BOT MESSAGE')
Выдаёт ошибку:
AttributeError: 'NoneType' object has no attribute 'lower'
А если пишу if event.object.text() == 'слово':
то пишет:
TypeError: 'NoneType' object is not callable.