mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Added Client.uptime (#533)
* Added Client.uptime * Added Client.uptime * Update Client.js
This commit is contained in:
@@ -94,6 +94,11 @@ class Client extends EventEmitter {
|
||||
* @type {?String}
|
||||
*/
|
||||
this.password = null;
|
||||
/**
|
||||
* The time in milliseconds the Client connected
|
||||
* @type {?Number}
|
||||
*/
|
||||
this.readyTime = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +129,14 @@ class Client extends EventEmitter {
|
||||
return this.rest.methods.loginToken(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* The uptime for the logged in Client
|
||||
* @type {?Number}
|
||||
*/
|
||||
get uptime() {
|
||||
return this.readyTime ? Date.now() - this.readyTime : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
|
||||
Reference in New Issue
Block a user