B
B
Bicbai2019-12-14 21:30:59
PHP
Bicbai, 2019-12-14 21:30:59

Possibility and work with VK API - chat_kick_user via Callback API?

Immediately to the problem: Can I send some kind of action if the bot was kicked out of the conversation and how to check this correctly.
I added a simple text that PMs the one who kicked writes, but nothing comes if you kick the bot :(

if($chat_act->type == 'chat_kick_user'){//кик из беседы
 $vk->sendMessage($id, "❗кик бота!");
  //--------------
  if($chat_act->member_id == '-187956757'){
      R::exec('DELETE FROM `settings` WHERE peer_id = ?', [$peer_id]);
    exit;
  }
}

Is there any other option to make an action if the bot is kicked?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lev Zabudkin, 2019-12-14
@zabudkin

In the sense of a bot kicked?
Check through FOR and so on, whether there is or not.
And with regards to actions, then ...
$chat_act-> action,
well, if you know what they are and what parameters to pass to them.
$chat_act is essentially a class that has its own functions and procedures (an outdated concept), and you can pass whatever you want there.
$chat_act->
I don’t know what function you have, but in theory:
$chat_act->delete(id here) - well, it’s clear to delete
$chat_act->forward(id too) - like forwarded
, etc., etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question