Answer the question
In order to leave comments, you need to log in
How to set the interval for executing a VKontakte bot command?
I would like to know how to set a limit on the use of a command. So that the command can be executed 1 time in 10 seconds.
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.from_chat:
user_message = event.object.message['text'].lower()
if user_message == '!привет':
vk.messages.send(random_id = get_random_id(),
message = (f"@id{id} ( {first_name}), здарова крутыш"),
chat_id = event.chat_id)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question