Client.readyTime -> readyAt (consistency)

This commit is contained in:
Schuyler Cebulskie
2016-10-06 21:48:25 -04:00
parent 93425c3979
commit 79b0d3f2a5
3 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -145,7 +145,7 @@ class Client extends EventEmitter {
* The date at which the Client was regarded as being in the `READY` state. * The date at which the Client was regarded as being in the `READY` state.
* @type {?Date} * @type {?Date}
*/ */
this.readyTime = null; this.readyAt = null;
this._timeouts = new Set(); this._timeouts = new Set();
this._intervals = new Set(); this._intervals = new Set();
@@ -170,7 +170,7 @@ class Client extends EventEmitter {
* @readonly * @readonly
*/ */
get uptime() { 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; 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 * 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. * much better to use a bot account rather than a user account.

View File

@@ -10,7 +10,7 @@ class ReadyHandler extends AbstractHandler {
const clientUser = new ClientUser(client, data.user); const clientUser = new ClientUser(client, data.user);
client.user = clientUser; client.user = clientUser;
client.readyTime = new Date(); client.readyAt = new Date();
client.users.set(clientUser.id, clientUser); client.users.set(clientUser.id, clientUser);
for (const guild of data.guilds) client.dataManager.newGuild(guild); for (const guild of data.guilds) client.dataManager.newGuild(guild);