A
A
Ambrel2018-07-11 17:43:11
PHP
Ambrel, 2018-07-11 17:43:11

Question about VK message?

In general, I have such a question, how to send messages to VK using php?
I found this on google:

function send($id , $message)
{
    $url = 'https://api.vk.com/method/messages.send';
    $params = array(
        'user_id' => $id,    // Кому отправляем
        'message' => $message,   // Что отправляем
        'access_token' => '0000000000000000000000000000',  // access_token можно вбить хардкодом, если работа будет идти из под одного юзера
        'v' => '5.37',
    );

    // В $result вернется id отправленного сообщения
    $result = file_get_contents($url, false, stream_context_create(array(
        'http' => array(
            'method'  => 'POST',
            'header'  => 'Content-type: application/x-www-form-urlencoded',
            'content' => http_build_query($params)
        )
    )));
}

But my account was blocked! Why ? Maybe I send too often? Approximately 2-4 messages in 3 minutes. Also I send to 3 users in a cycle. What am I doing wrong ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-07-11
@Sanasol

Maybe I send too often? Approximately 2-4 messages in 3 minutes. Also I send to 3 users in a cycle. What am I doing wrong ?

First complaints - instant ban after a few.
Secondly, you cannot send more than 20 or 40 messages per day to people not on your friends list.
So at least 4 minutes, in an hour with a penny, the limit will end.
Thirdly, no one canceled antispam, if there are identical messages + containing spam triggers (free, fictitious, etc.), then the ban will arrive even before the daily limit is reached.
If it was so easy to take and send messages to everyone in a personal message, everyone would have had a trash can for a long time.
They give a ban (or send complaints) even for very targeted messages, I caught a ban for a week, despite the fact that I sent 3-5-7 messages a day to an audience that was itself interested in such functionality.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question