A
A
amdkot2020-11-24 10:44:01
Node.js
amdkot, 2020-11-24 10:44:01

How to make a timer in node js?

How to make it so that after the bot hears the command phrase, the countdown starts and after it expires, this or that action is performed for the VK bot on node js?

For example, here is the code:

cmd.hear(/^(?:click)$/i, async (message, bot) => {
if(message.user.settings.adm < 2) return bot (`You are not an administrator 2 and above rank`);

if(message.user.instrument < 2) return bot (`You don't have a mining tool`);

let rangelezo = utils.random(1, 3);

message.user.balance += rangelezo ;

return bot(`you got ${rangelezo}`);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mopsicus, 2020-11-26
@mopsicus

https://learn.javascript.ru/settimeout-setinterval

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question