mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
Using ws.connection.status rather than undefined ws.status (#1429)
This commit is contained in:
parent
9ee695a291
commit
956372731f
2 changed files with 3 additions and 3 deletions
|
|
@ -190,7 +190,7 @@ class Client extends EventEmitter {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get status() {
|
get status() {
|
||||||
return this.ws.status;
|
return this.ws.connection.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -897,7 +897,7 @@ class Guild {
|
||||||
* @event Client#guildMemberAdd
|
* @event Client#guildMemberAdd
|
||||||
* @param {GuildMember} member The member that has joined a guild
|
* @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);
|
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);
|
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
|
* Emitted whenever a guild member changes - i.e. new role, removed role, nickname
|
||||||
* @event Client#guildMemberUpdate
|
* @event Client#guildMemberUpdate
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue