fix: Add empty role list if not present (#1871)

This commit is contained in:
Paulo
2021-06-12 16:31:01 -03:00
committed by GitHub
parent 08507c0603
commit f47001a1c9

View File

@@ -125,12 +125,16 @@ namespace Discord.WebSocket
{
var entity = new SocketGuildUser(guild, guild.Discord.GetOrCreateUser(state, model.User));
entity.Update(state, model);
if (!model.Roles.IsSpecified)
entity.UpdateRoles(new ulong[0]);
return entity;
}
internal static SocketGuildUser Create(SocketGuild guild, ClientState state, PresenceModel model)
{
var entity = new SocketGuildUser(guild, guild.Discord.GetOrCreateUser(state, model.User));
entity.Update(state, model, false);
if (!model.Roles.IsSpecified)
entity.UpdateRoles(new ulong[0]);
return entity;
}
internal void Update(ClientState state, MemberModel model)