mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Using ws.connection.status rather than undefined ws.status (#1429)
This commit is contained in:
@@ -190,7 +190,7 @@ class Client extends EventEmitter {
|
||||
* @readonly
|
||||
*/
|
||||
get status() {
|
||||
return this.ws.status;
|
||||
return this.ws.connection.status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user