Browse Source

Build the Server.EveryoneRole object early just in case

tags/docs-0.9
RogueException 9 years ago
parent
commit
4e9a2833e1
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      src/Discord.Net/Models/Server.cs

+ 3
- 6
src/Discord.Net/Models/Server.cs View File

@@ -102,7 +102,8 @@ namespace Discord
_members = new ConcurrentDictionary<long, ServerMember>();

//Local Cache
_bans = new ConcurrentDictionary<long, bool>();
_bans = new ConcurrentDictionary<long, bool>();
EveryoneRole = _client.Roles.GetOrAdd(id, id);
}
internal override bool LoadReferences()
{
@@ -254,11 +255,7 @@ namespace Discord
}
internal void RemoveRole(Role role)
{
if (_roles.TryRemove(role.Id, out role))
{
if (role.Id == Id)
EveryoneRole = null;
}
_roles.TryRemove(role.Id, out role);
}

internal ServerPermissions GetPermissions(User user)


Loading…
Cancel
Save