Beispiel #1
0
        public async Task GetViewersInfoAsync(string channelName)
        {
            if (channelName.Length == 0)
            {
                Logger.Log("Channel name is empy.");
                return;
            }

            // Change the name to lowercase, because twitch api only works with lowercase names
            channelName = channelName.ToLower();

            Logger.Log($"Getting information for channel: {channelName}...");

            var streamer = new StreamerInformation(channelName, ClientId);
            await streamer.GetChattersInformationAsync();

            await streamer.GetStreamInformationAsync();

            var featuredStreams = await TwitchApi.GetFeaturedStreamsAsync(TwitchViewerCounterConfiguration.Instance.GetFeaturedStreamsLocation(),
                                                                          TwitchViewerCounterConfiguration.Instance.GetFeaturedStreamsLanguage());

            var featuredStream = StreamHelpers.CheckIfStreamIsFeatured(streamer.Stream, featuredStreams.Featured);

            await DisplayInformation(streamer, channelName, featuredStream);
        }