コード例 #1
0
        private async void GoodBigScorePercentageHandler(int totalGamesCount, int totalBigScoresCount,
                                                         string player1Name, string player2Name)
        {
            var allAuthedChats = await _chatsRepository.GetAllChatsAsync();

            var message = "🏓 *Table Tennis*\n";

            message += $"{player1Name} vs {player2Name}\n";
            message += $"Total games analyzed: {totalGamesCount}\n";
            message += $"BigScores percentage: {Math.Round(totalBigScoresCount * 100.0 / totalGamesCount, 2)}%\n";
            message += "`There is a big chance of rounds have odd score.`";

            foreach (var chatId in allAuthedChats)
            {
                await _botClient.SendTextMessageAsync(chatId, message, ParseMode.Markdown);
            }
        }