Browse Source

Fixed CachedVoiceChannel.Members

pull/108/head
RogueException 9 years ago
parent
commit
ea5da958b2
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      src/Discord.Net/Entities/WebSocket/CachedGuild.cs
  2. +1
    -1
      src/Discord.Net/Entities/WebSocket/CachedVoiceChannel.cs

+ 1
- 0
src/Discord.Net/Entities/WebSocket/CachedGuild.cs View File

@@ -42,6 +42,7 @@ namespace Discord
} }
} }
public IReadOnlyCollection<CachedGuildUser> Members => _members.ToReadOnlyCollection(); public IReadOnlyCollection<CachedGuildUser> Members => _members.ToReadOnlyCollection();
public IEnumerable<KeyValuePair<ulong, VoiceState>> VoiceStates => _voiceStates;
public CachedGuild(DiscordSocketClient discord, ExtendedModel model, DataStore dataStore) : base(discord, model) public CachedGuild(DiscordSocketClient discord, ExtendedModel model, DataStore dataStore) : base(discord, model)
{ {


+ 1
- 1
src/Discord.Net/Entities/WebSocket/CachedVoiceChannel.cs View File

@@ -12,7 +12,7 @@ namespace Discord
public new CachedGuild Guild => base.Guild as CachedGuild; public new CachedGuild Guild => base.Guild as CachedGuild;


public IReadOnlyCollection<IGuildUser> Members public IReadOnlyCollection<IGuildUser> Members
=> Guild.Members.Where(x => x.VoiceChannel.Id == Id).ToImmutableArray();
=> Guild.VoiceStates.Where(x => x.Value.VoiceChannel.Id == Id).Select(x => Guild.GetUser(x.Key)).ToImmutableArray();


public CachedVoiceChannel(CachedGuild guild, Model model) public CachedVoiceChannel(CachedGuild guild, Model model)
: base(guild, model) : base(guild, model)


Loading…
Cancel
Save