A
A
Artur2020-06-19 15:43:28
Python
Artur, 2020-06-19 15:43:28

__call__() takes 1 positional argument but 3 were given how to solve?

elif message[0] == '/kick':
          user = message[1]
          chat_id = peer_id
          vk.method('messages.removeChatUser', {'chat_id': chat_id, 'member_id': user})


Throws an error: __call__() takes 1 positional argument but 3 were given

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2020-06-19
@rackev

Here is an example of a kick on a reply to a message

vk.method("messages.removeChatUser", {
      "chat_id": event.object.peer_id - 2000000000,
      "member_id": event.obj.reply_message['from_id']
})

Chat ID is not a peer ID, but a peer ID - 2000000000.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question