M
M
Matthew Stafford2018-02-03 22:47:12
JavaScript
Matthew Stafford, 2018-02-03 22:47:12

API.VKONTAKTE | How to kick a user from a conversation using JAVASCRIPT?

Hello!
Can you please tell me how to implement a user kick from a conversation using JAVASCRIPT?
I have this code:

<script>
  function kickUser() {
    VK.api("messages.removeChatUser", {"access_token": "<?php echo $access_token; ?>","user_id": "<?php echo $chatPreview->id; ?>","chat_id": "<?php echo $chat_id; ?>"}, function (data) {
      alert("Kicked");
    });
  }
</script>

And I call it with onclick="return kickUser();"

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