Пример #1
0
        /// <summary>
        /// Gets a list of live streams that the user is following. Requires user authorization.
        /// </summary>
        /// <returns>A list of streams</returns>
        public async Task <List <Stream> > RetrieveOnlineFollowedStreams()
        {
            if (authorized && authorizedScopes.Contains(TwitchConstants.Scope.UserRead))
            {
                Uri uri;
                uri = new Uri("https://api.twitch.tv/kraken/streams/followed");
                string responseString = await Twixel.GetWebData(uri, accessToken);

                followedStreams = twixel.LoadStreams(JObject.Parse(responseString));
                return(followedStreams);
            }
            else
            {
                if (!authorized)
                {
                    twixel.CreateError(name + " is not authorized");
                }
                else if (!authorizedScopes.Contains(TwitchConstants.Scope.UserRead))
                {
                    twixel.CreateError(name + " has not given user_read permissions");
                }
                return(null);
            }
        }