mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix/docs(Client): type status and do not throw an error if accessed before login
This commit is contained in:
@@ -186,11 +186,11 @@ class Client extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Current status of the client's connection to Discord
|
||||
* @type {?number}
|
||||
* @type {Status}
|
||||
* @readonly
|
||||
*/
|
||||
get status() {
|
||||
return this.ws.connection.status;
|
||||
return this.ws.connection ? this.ws.connection.status : Constants.Status.IDLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user