Answer the question
In order to leave comments, you need to log in
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
Because you, without reading a single tutorial, wrote code that does nothing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question