Added nick to PRESENCE_UPDATE

This commit is contained in:
RogueException
2016-06-12 20:30:10 -03:00
parent 4601347ec8
commit 031d178303
3 changed files with 8 additions and 3 deletions

View File

@@ -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; }
}
}

View File

@@ -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)

View File

@@ -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)
{