Browse Source

Changed User.Channels to check for the Connect perm on voice channels

tags/docs-0.9
RogueException 9 years ago
parent
commit
7d2ce35d4a
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/Discord.Net/Models/User.cs

+ 3
- 2
src/Discord.Net/Models/User.cs View File

@@ -96,7 +96,7 @@ namespace Discord
}
}

/// <summary> Returns a collection of all channels this user is a member of. </summary>
/// <summary> Returns a collection of all channels this user has permissions to join on this server. </summary>
[JsonIgnore]
public IEnumerable<Channel> Channels
{
@@ -105,7 +105,8 @@ namespace Discord
if (_server.Id != null)
{
return Server.Channels
.Where(x => x.GetPermissions(this).ReadMessages);
.Where(x => (x.Type == ChannelType.Text && x.GetPermissions(this).ReadMessages) ||
(x.Type == ChannelType.Voice && x.GetPermissions(this).Connect));
}
else
{


Loading…
Cancel
Save