mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
VoiceChannel#members should be a Collection, not an Array
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const GuildChannel = require('./GuildChannel');
|
const GuildChannel = require('./GuildChannel');
|
||||||
const { browser } = require('../util/Constants');
|
const { browser } = require('../util/Constants');
|
||||||
const Permissions = require('../util/Permissions');
|
const Permissions = require('../util/Permissions');
|
||||||
|
const Collection = require('../util/Collection');
|
||||||
const { Error } = require('../errors');
|
const { Error } = require('../errors');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,9 +30,9 @@ class VoiceChannel extends GuildChannel {
|
|||||||
* @name VoiceChannel#members
|
* @name VoiceChannel#members
|
||||||
*/
|
*/
|
||||||
get members() {
|
get members() {
|
||||||
return this.guild.voiceStates
|
return new Collection(this.guild.voiceStates
|
||||||
.filter(state => state.channelID === this.id && state.member)
|
.filter(state => state.channelID === this.id && state.member)
|
||||||
.map(state => state.member);
|
.map(state => state.member));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user