A
A
Andrew_Kartoshka2019-12-25 15:11:35
Python
Andrew_Kartoshka, 2019-12-25 15:11:35

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

3 answer(s)
A
Andrey, 2019-12-25
@anerev

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

C
che_aa, 2019-12-26
@che_aa

https://vk.com/dev/messages.getDialogs
Change count in a loop and save to an array, for example

K
Kirill Minovsky, 2020-01-19
@Runnin

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 question

Ask a Question

731 491 924 answers to any question