Example #1
0
        private void AnnounceStreamOffline(StreamInfo streamInfo)
        {
            var message = $"{streamInfo.Name} is done streaming and here are some stats.\n" +
                          $"Title: **{streamInfo.Title}**\n";

            if (streamInfo.GamesPlayed.Count > 1)
            {
                var games = "Games:\n";
                foreach (var game in streamInfo.GamesPlayed)
                {
                    games += $"**{game}**\n";
                }
                message += games;
            }
            else if (streamInfo.GamesPlayed.Count == 1)
            {
                message += $"Games: **{streamInfo.GamesPlayed.First()}**\n";
            }

            var duration = DateTime.UtcNow - streamInfo.StreamStart;

            message += $"Duration: **{duration.Hours}h{duration.Minutes}m{duration.Seconds}s**\n" +
                       $"Viewers Average: **{streamInfo.CalculateAverageViewers()}** - High: **{streamInfo.MaxViewers}**\n" +
                       $"Followers Session: **{streamInfo.Followers - streamInfo.FollowersStart}** - Total: **{streamInfo.Followers}**";

            _statsDiscordClient.SendTextMessage(message);
        }