From bb9f144eae13794463af2cabff4f4554aee2b826 Mon Sep 17 00:00:00 2001 From: Christopher F Date: Tue, 21 Feb 2017 16:19:33 -0500 Subject: [PATCH] Remove implicit SocketGuildUser.RoleIds; refactor Roles to ReadOnly --- src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs b/src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs index 55c676901..5162839d7 100644 --- a/src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs +++ b/src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs @@ -33,8 +33,7 @@ namespace Discord.WebSocket public bool IsDeafened => VoiceState?.IsDeafened ?? false; public bool IsMuted => VoiceState?.IsMuted ?? false; public DateTimeOffset? JoinedAt => DateTimeUtils.FromTicks(_joinedAtTicks); - public IEnumerable Roles => _roleIds.Select(id => Guild.GetRole(id)); - public IReadOnlyCollection RoleIds => _roleIds; + public IEnumerable Roles => _roleIds.Select(id => Guild.GetRole(id)).ToReadOnlyCollection(() => _roleIds.Count()); public SocketVoiceChannel VoiceChannel => VoiceState?.VoiceChannel; public string VoiceSessionId => VoiceState?.VoiceSessionId ?? ""; public SocketVoiceState? VoiceState => Guild.GetVoiceState(Id); @@ -117,7 +116,7 @@ namespace Discord.WebSocket //IGuildUser IGuild IGuildUser.Guild => Guild; ulong IGuildUser.GuildId => Guild.Id; - IReadOnlyCollection IGuildUser.RoleIds => RoleIds; + IReadOnlyCollection IGuildUser.RoleIds => _roleIds; //IUser Task IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)