Exemplo n.º 1
0
        public UnregisterStatus Unregister(string Username)
        {
            GetUsersResponse resp = api.Helix.Users.GetUsersAsync(logins: new List <string>()
            {
                Username
            }).Result;
            List <UserResponse> user = resp.Users.Select(t => new UserResponse(t)).ToList();

            if (user.Count == 0)
            {
                return(UnregisterStatus.UserNotFound);
            }

            if (!Tracking.Contains(user[0].Id))
            {
                return(UnregisterStatus.NotTracking);
            }

            Tracking.Remove(user[0].Id);
            UserDatabase.Remove(user[0].Id);

            Offline.Remove(user[0].Id);
            Online.Remove(user[0].Id);

            return(UnregisterStatus.Success);
        }