S
S
ShlapaValdisa2021-03-22 14:13:24
Python
ShlapaValdisa, 2021-03-22 14:13:24

I'm making a Python bot in VK for newsletters. and I have a question. Namely, why does it immediately turn off after starting?

import vk_api
from vk_api.utils import get_random_id

def main():
vk_session = vk_api.VKApi(token='token')
vk = vk_session.get_api()

user_list = [1, 2, 3, 4,]

for id in user_list:
vk .messages.send(
user_id=id,
random_id=get_random_id(),
message="text"
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-03-22
@ShlapaValdisa

Because you, without reading a single tutorial, wrote code that does nothing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question