internal void Update(MemberPresence model) { if (model.User != null) { Update(model.User as UserReference); } if (model.Roles != null) { UpdateRoles(model.Roles.Select(x => Server.GetRole(x))); } if (model.Status != null && Status != model.Status) { Status = UserStatus.FromString(model.Status); if (Status == UserStatus.Offline) { _lastOnline = DateTime.UtcNow; } } if (model.Game != null) { CurrentGame = new Game(model.Game.Name, model.Game.Type ?? GameType.Default, model.Game.Url); } else { CurrentGame = null; } }
internal void Update(MemberPresence model) { if (model.User != null) { Update(model.User as UserReference); } if (model.Roles != null) { UpdateRoles(model.Roles.Select(x => Server.GetRole(x))); } if (model.Status != null && Status != model.Status) { Status = UserStatus.FromString(model.Status); if (Status == UserStatus.Offline) { _lastOnline = DateTime.UtcNow; } } CurrentGame = model.Game?.Name; //Allows null }
internal void Update(PresenceInfo model) { if (model.User != null) { Update(model.User as UserReference); } if (model.Roles != null) { UpdateRoles(model.Roles.Select(x => _client.Roles[x])); } if (model.Status != null && Status != model.Status) { Status = UserStatus.FromString(model.Status); if (Status == UserStatus.Offline) { _lastOnline = DateTime.UtcNow; } } GameId = model.GameId; //Allows null }