import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
import config_py
token = config_py.token
vk_session = vk_api.VkApi(token=token)
vk = vk_session.get_api()
longpoll = VkLongPoll(vk_session)
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
Peer_id = event.peer_id
try:
User_id = event.user_id
except AttributeError:
pass
text = event.text.lower()
text2 = re.split(r' ', text)
if text2[0] == '!info' or text2[0] == '!инфо':
vk.messages.send(peer_id=Peer_id, message='Дежурный "название не придумал"', random_id=0)
elif text2[0] == '!kick':
vk.method("messages.removeChatUser", chat_id = Peer_id, member_id=even=t.raw["object"]["reply_message"], random_id = 0)
vk.messages.send(peer_id=Peer_id, message='Пользователь забанен!', random_id=0)
TypeError: list indices must be integers or slices, not str
(использую и callback and longpoll последнии версии)