Using ws.connection.status rather than undefined ws.status (#1429)

This commit is contained in:
SpaceEEC
2017-04-28 21:27:30 +02:00
committed by Crawl
parent 9ee695a291
commit 956372731f
2 changed files with 3 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ class Client extends EventEmitter {
* @readonly
*/
get status() {
return this.ws.status;
return this.ws.connection.status;
}
/**

View File

@@ -897,7 +897,7 @@ class Guild {
* @event Client#guildMemberAdd
* @param {GuildMember} member The member that has joined a guild
*/
if (this.client.ws.status === Constants.Status.READY && emitEvent && !existing) {
if (this.client.ws.connection.status === Constants.Status.READY && emitEvent && !existing) {
this.client.emit(Constants.Events.GUILD_MEMBER_ADD, member);
}
@@ -912,7 +912,7 @@ class Guild {
const notSame = member.nickname !== oldMember.nickname || !Util.arraysEqual(member._roles, oldMember._roles);
if (this.client.ws.status === Constants.Status.READY && notSame) {
if (this.client.ws.connection.status === Constants.Status.READY && notSame) {
/**
* Emitted whenever a guild member changes - i.e. new role, removed role, nickname
* @event Client#guildMemberUpdate