N
N
Nikita Kudrin2020-08-07 19:09:25
JavaScript
Nikita Kudrin, 2020-08-07 19:09:25

How to fix stopwatch in status?

Hey!

client.on('ready', () => {
  var v=0;
  var m=0;
  var c=0;
  
  var timer1 = client.setInterval(function () {      
        if(v > 60) {
        var m = m + 1
        var v = 0
      };
      if(m > 60) {
        var c = c + 1;
        var m = 0;
        var v = 0;
      }; 
     } ,1000)
  
        var timer = client.setInterval(function () {    
          client.user.setActivity(`за сервером уже ${c}:${m}:${v}`, {type: 'WATCHING'});
         var v = v + 1
        },1000)
      });

As a result, it turns out: 5f2d7c20e327e815265481.png
And there should be a "stopwatch" in the status.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-08-07
@Alexandre888

why make it so hard? simple stopwatch:

for (var i = 0; i < 60; i++) {
     bot.user.setActivity(i + "секунд");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question