C
C
cl0wnof2020-11-18 22:25:23
Node.js
cl0wnof, 2020-11-18 22:25:23

How to create an uptime timer in Discord JS?

I have a bot on Discord JS
How do I make an Uptime timer from the start of the bot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-11-19
@cl0wnof

you can use the property - it returns the time in milliseconds elapsed since the bot last entered the state (i.e. the time elapsed since the bot was last launched): if you want to know the creation date of the bot's account, you can use the property : if you want to know when any of the files have been created, you can use the function : .uptimeREADY
var creationDate = Date.now() - client.uptime;
var creationDate = client.user.createdAt;

var fs = require('fs');
fs.stat('путь_к_файлу', (err, stat) => {
   if(err) throw(err);
   var creationDate = stat.birthtime; // ( * )
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question