P
P
prostiim2020-08-29 20:56:02
Python
prostiim, 2020-08-29 20:56:02

API request not sent. What to do?

Hello!

I wrote a small code, to send messages via conversations via the VK API and via the requests
chat_id library, I take the following method

id  = 0 #Переменная для chat_id
number = 0 #Что бы чекать какой цикл

while True:
    s = requests.Session()
    params = {
        'chat_id': id,
        'message': msg, #переменная с сообщением
        'access_token': token, #токен
        'random_id': 0,
        'v': 5.122
    }
    s.post('https://api.vk.com/method/messages.send', params=params)
    id += 1
    number += 1
    print("Число циклов: " + str(number))

The request itself is sent, everything gets into the conversations, BUT, when I check the logs, it says that 10 cycles have been made, but when I look, it went only 2-4 conversations. What?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2020-08-30
@HemulGM

What?

What, what, captcha, that's what.
Do you think you are the only smart one? Spam in chats.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question