I
I
Ivan Wagner2019-09-20 17:27:25
PHP
Ivan Wagner, 2019-09-20 17:27:25

How to make a team opposite kick?

Good afternoon! There is a "kick" command in the bot. When you make a reply message and add the word kick, the bot kicks this person from the conversation. here is the code:

elseif($cmd == 'кикнуть'){
    if($reply_author == ''){
      $vk->sendMessage($peer_id, "@id{$id} ({$first_name}), вы не указали человека, которого нужно исключить (перешлите любое его сообщение)");
    }else{
      $userInfo_reply = $vk->request("users.get", ["user_ids" => $reply_author]);
      $first_name_reply = $userInfo[0]['first_name'];
      $vk->sendMessage($peer_id, "@id{$reply_author} ({$userinfo_reply}), прощайте");
      $vk->request('messages.removeChatUser', ['chat_id' => $chat_id, 'member_id' => $reply_author]);
    }

Question, how can you implement the same thing, exactly the opposite? Where to dig, how much will have to be changed? I don't know much about php

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2019-09-20
@xmoonlight

You need to find a function opposite to 'messages.removeChatUser' in the VK API documentation.
The code structure is the same.

D
devil's jackal, 2019-10-16
@Deathfinite

If you write a bot on a page, then you can return users, but in PHP it will probably be more difficult to do, and not according to the rules.
And if the group is just a kick. Inviting anyone on behalf of the group is not and has never been possible. :|

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question