Added nick to PRESENCE_UPDATE
This commit is contained in:
@@ -8,11 +8,14 @@ namespace Discord.API
|
||||
public User User { get; set; }
|
||||
[JsonProperty("guild_id")]
|
||||
public Optional<ulong> GuildId { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public Optional<ulong[]> Roles { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public UserStatus Status { get; set; }
|
||||
[JsonProperty("game")]
|
||||
public Game Game { get; set; }
|
||||
|
||||
[JsonProperty("roles")]
|
||||
public Optional<ulong[]> Roles { get; set; }
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nick { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@ namespace Discord
|
||||
else
|
||||
{
|
||||
guild.AddOrUpdatePresence(data);
|
||||
if (data.Roles.IsSpecified) //Happens when a user we haven't seen before logs in
|
||||
if (data.Roles.IsSpecified || data.Nick.IsSpecified) //Happens when a user we haven't seen before logs in
|
||||
{
|
||||
CachedGuildUser user = guild.GetUser(data.User.Id);
|
||||
if (user == null)
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace Discord
|
||||
|
||||
if (model.Roles.IsSpecified)
|
||||
UpdateRoles(model.Roles.Value);
|
||||
if (model.Nick.IsSpecified)
|
||||
Nickname = model.Nick.Value;
|
||||
}
|
||||
public void Update(VoiceStateModel model, UpdateSource source)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user