A
A
aniki14772021-12-15 14:33:00
In contact with
aniki1477, 2021-12-15 14:33:00

VK removeChatUser what is wrong?

Where is the mistake?

for event in longpoll.listen():
  if event.type == VkBotEventType.MESSAGE_NEW:
    if event.from_chat:

      id = event.chat_id
      msg = event.object.message['text'].lower()
                       #Забанить пользователя
      if msg == "/бан":
        vk_session.method("messages.removeChatUser", {"chat_id": event.object.peer_id - 2000000000,"member_id": event.obj.reply_message['from_id']})


File "E:\Python\bot_vk\Shtsirlits.py", line 60, in
vk_session.method("messages.removeChatUser", {"chat_id": event.object.peer_id - 2000000000,"member_id": event.obj.reply_message ['from_id']})
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

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