import vk_api
import requests
import random
vk_session = vk_api.VkApi(token='token')
from vk_api.longpoll import VkLongPoll, VkEventType
longpoll = VkLongPoll(vk_session)
vk = vk_session.get_api()
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
usergive=vk.users.get(user_ids=event.user_id)
idgive=vk.users.get(user_ids=event.user_id)
id=idgive[0]['id']
name=usergive[0]['first_name']
if event.text == "НАРУТООО":
if event.from_user:
print(vk.messages.send(
user_id=event.user_id,
message='САСКЕЕЕЕ',
random_id=0
))
elif event.from_chat:
vk.messages.send(
peer_id=2000000002,
message="САСКЕЕЕЕ",
random_id= 0
)
Когда пишу в беседу ошибки не выдает