mirror of
https://github.com/danbulant/discord.js
synced 2026-06-05 15:51:31 +00:00
More preformant way, forgot to commit this before whoops
This commit is contained in:
parent
c1183f3534
commit
f9da255b44
1 changed files with 7 additions and 3 deletions
|
|
@ -30,9 +30,13 @@ class VoiceChannel extends GuildChannel {
|
||||||
* @name VoiceChannel#members
|
* @name VoiceChannel#members
|
||||||
*/
|
*/
|
||||||
get members() {
|
get members() {
|
||||||
return new Collection(this.guild.voiceStates
|
const coll = new Collection();
|
||||||
.filter(state => state.channelID === this.id && state.member)
|
for (const state of this.guild.voiceStates.values()) {
|
||||||
.map(state => [state.id, state.member]));
|
if (state.channelID === this.id && state.member) {
|
||||||
|
coll.set(state.id, state.member);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return coll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue