Browse Source

Remove implicit SocketGuildUser.RoleIds; refactor Roles to ReadOnly

tags/1.0-rc
Christopher F 8 years ago
parent
commit
bb9f144eae
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs

+ 2
- 3
src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs View File

@@ -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<SocketRole> Roles => _roleIds.Select(id => Guild.GetRole(id));
public IReadOnlyCollection<ulong> RoleIds => _roleIds;
public IEnumerable<SocketRole> 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<ulong> IGuildUser.RoleIds => RoleIds;
IReadOnlyCollection<ulong> IGuildUser.RoleIds => _roleIds;

//IUser
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)


Loading…
Cancel
Save