Answer the question
In order to leave comments, you need to log in
vk api. How to get a list of chat id conversations that have a bot?
How to implement it? Perhaps there is some method.
Answer the question
In order to leave comments, you need to log in
At least you would open Google or read the documentation, it is in Russian, it's 30 seconds of searching. https://vk.com/dev/messages.getConversations
https://vk.com/dev/messages.getDialogs
Change count in a loop and save to an array, for example
Here is the schematic code for getting the id of conversations that have a bot. If $count = 20, then there are conversations 2000000000-2000000020. Instead of sending a message, you can use any method that works with conversations
$i = 0;
$count = 0;
while (true) {
try {
$this->sendMessage(2000000000 + $i, $message);
$count++;
} catch (Exception $e) {
if ($e->getCode() == 10) {
//значит такой беседы уже не существует, т.к. она является последней
exit($count)
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question