for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text == 'привет':
if event.from_user:
print('Получено сообщение от', event.user_id)
vk.messages.send(
user_id=event.user_id,
message='Привет'
)
if event.from_chat:
vk.messages.send(
chat_id=event.chat_id,
message='Привет'
)
Получено сообщение от 217185147
Traceback (most recent call last):
File "E:/SOFT/japonka.py", line 18, in <module>
message='Привет'
File "C:\Users\byela\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\vk_api.py", line 671, in __call__
return self._vk.method(self._method, kwargs)
File "C:\Users\byela\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\vk_api.py", line 636, in method
raise error
vk_api.exceptions.ApiError: [100] One of the parameters specified was missing or invalid: random_id is a required parameter