Move guild presence updates to GuildMemberUpdated. Filter duplicate UserUpdated events.
This commit is contained in:
@@ -11,12 +11,12 @@ namespace Discord.API
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nick { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public ulong[] Roles { get; set; }
|
||||
public Optional<ulong[]> Roles { get; set; }
|
||||
[JsonProperty("joined_at")]
|
||||
public Optional<DateTimeOffset> JoinedAt { get; set; }
|
||||
[JsonProperty("deaf")]
|
||||
public bool Deaf { get; set; }
|
||||
public Optional<bool> Deaf { get; set; }
|
||||
[JsonProperty("mute")]
|
||||
public bool Mute { get; set; }
|
||||
public Optional<bool> Mute { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,12 @@ namespace Discord.Rest
|
||||
_joinedAtTicks = model.JoinedAt.Value.UtcTicks;
|
||||
if (model.Nick.IsSpecified)
|
||||
Nickname = model.Nick.Value;
|
||||
IsDeafened = model.Deaf;
|
||||
IsMuted = model.Mute;
|
||||
UpdateRoles(model.Roles);
|
||||
if (model.Deaf.IsSpecified)
|
||||
IsDeafened = model.Deaf.Value;
|
||||
if (model.Mute.IsSpecified)
|
||||
IsMuted = model.Mute.Value;
|
||||
if (model.Roles.IsSpecified)
|
||||
UpdateRoles(model.Roles.Value);
|
||||
}
|
||||
private void UpdateRoles(ulong[] roleIds)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user