mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Client.readyTime -> readyAt (consistency)
This commit is contained in:
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.
|
* 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.
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user