fix: skip bot in counter
parent
3c1a66eec1
commit
2cf11e2784
|
@ -117,6 +117,7 @@ client.on(GatewayDispatchEvents.VoiceStateUpdate, async ({ data, api }) => {
|
||||||
hasMe = true
|
hasMe = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if (state.bot) continue
|
||||||
counter++
|
counter++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ export class VoiceState {
|
||||||
channelId!: Snowflake | null
|
channelId!: Snowflake | null
|
||||||
|
|
||||||
mute!: boolean
|
mute!: boolean
|
||||||
|
bot!: boolean
|
||||||
|
|
||||||
constructor(data: GuildVoiceState, public guild: Snowflake) {
|
constructor(data: GuildVoiceState, public guild: Snowflake) {
|
||||||
this.update(data)
|
this.update(data)
|
||||||
|
@ -40,5 +41,6 @@ export class VoiceState {
|
||||||
this.channelId = data.channel_id
|
this.channelId = data.channel_id
|
||||||
this.id = data.user_id
|
this.id = data.user_id
|
||||||
this.mute = data.mute || data.self_mute
|
this.mute = data.mute || data.self_mute
|
||||||
|
this.bot = data.member?.user?.bot ?? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue