| @@ -8,11 +8,14 @@ namespace Discord.API | |||||
| public User User { get; set; } | public User User { get; set; } | ||||
| [JsonProperty("guild_id")] | [JsonProperty("guild_id")] | ||||
| public Optional<ulong> GuildId { get; set; } | public Optional<ulong> GuildId { get; set; } | ||||
| [JsonProperty("roles")] | |||||
| public Optional<ulong[]> Roles { get; set; } | |||||
| [JsonProperty("status")] | [JsonProperty("status")] | ||||
| public UserStatus Status { get; set; } | public UserStatus Status { get; set; } | ||||
| [JsonProperty("game")] | [JsonProperty("game")] | ||||
| public Game Game { get; set; } | 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 | else | ||||
| { | { | ||||
| guild.AddOrUpdatePresence(data); | 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); | CachedGuildUser user = guild.GetUser(data.User.Id); | ||||
| if (user == null) | if (user == null) | ||||
| @@ -74,6 +74,8 @@ namespace Discord | |||||
| if (model.Roles.IsSpecified) | if (model.Roles.IsSpecified) | ||||
| UpdateRoles(model.Roles.Value); | UpdateRoles(model.Roles.Value); | ||||
| if (model.Nick.IsSpecified) | |||||
| Nickname = model.Nick.Value; | |||||
| } | } | ||||
| public void Update(VoiceStateModel model, UpdateSource source) | public void Update(VoiceStateModel model, UpdateSource source) | ||||
| { | { | ||||