mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
Client.readyTime -> readyAt (consistency)
This commit is contained in:
parent
93425c3979
commit
79b0d3f2a5
3 changed files with 12 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
|
@ -145,7 +145,7 @@ class Client extends EventEmitter {
|
|||
* The date at which the Client was regarded as being in the `READY` state.
|
||||
* @type {?Date}
|
||||
*/
|
||||
this.readyTime = null;
|
||||
this.readyAt = null;
|
||||
|
||||
this._timeouts = new Set();
|
||||
this._intervals = new Set();
|
||||
|
|
@ -170,7 +170,7 @@ class Client extends EventEmitter {
|
|||
* @readonly
|
||||
*/
|
||||
get uptime() {
|
||||
return this.readyTime ? Date.now() - this.readyTime : null;
|
||||
return this.readyAt ? Date.now() - this.readyAt : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -195,6 +195,14 @@ class Client extends EventEmitter {
|
|||
return emojis;
|
||||
}
|
||||
|
||||
/**
|
||||
* The timestamp that the client was last ready at
|
||||
* @type {?number}
|
||||
*/
|
||||
get readyTimestamp() {
|
||||
return this.readyAt ? this.readyAt.getTime() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the client in. If successful, resolves with the account's token. <warn>If you're making a bot, it's
|
||||
* much better to use a bot account rather than a user account.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class ReadyHandler extends AbstractHandler {
|
|||
|
||||
const clientUser = new ClientUser(client, data.user);
|
||||
client.user = clientUser;
|
||||
client.readyTime = new Date();
|
||||
client.readyAt = new Date();
|
||||
client.users.set(clientUser.id, clientUser);
|
||||
|
||||
for (const guild of data.guilds) client.dataManager.newGuild(guild);
|
||||
|
|
|
|||
Loading…
Reference in a new issue