def show_teams_streaks_maccabi_with_clean_sheets_action(update, context): games = MaccabiGamesFiltering(context.user_data[_USER_DATE_GAMES_FILTER_KEY]).filter_games() top = games.teams_streaks.get_teams_with_best_clean_sheets_streak() top_teams_html_text = transform_teams_with_maccabi_games_to_telegram_html_text(top) query = update.callback_query query.edit_message_text(parse_mode=ParseMode.HTML, text=f"היריבות עם הרצף 'מכבי שמרה על רשת נקייה' הארוך ביותר: \n{top_teams_html_text}") return go_to_more_stats_or_finish_menu(update, context)
def show_teams_streaks_maccabi_score_at_least_a_goal_action(update, context): games = MaccabiGamesFiltering(context.user_data[_USER_DATE_GAMES_FILTER_KEY]).filter_games() top = games.teams_streaks.get_teams_with_current_maccabi_score_goal_streak() top_teams_html_text = transform_teams_with_maccabi_games_to_telegram_html_text(top) query = update.callback_query query.edit_message_text(parse_mode=ParseMode.HTML, text=f"היריבות עם הרצף 'מכבי הבקיעה לפחות גול אחד' הארוך ביותר: \n{top_teams_html_text}") return go_to_more_stats_or_finish_menu(update, context)
def show_summary_stats_action(update, context): games = MaccabiGamesFiltering( context.user_data[_USER_DATE_GAMES_FILTER_KEY]).filter_games() summary_stats = transform_stats_to_pretty_hebrew_text( games.results.json_dict()) query = update.callback_query query.edit_message_text(text=summary_stats) return go_to_more_stats_or_finish_menu(update, context)
def show_most_captain_action(update, context): games = MaccabiGamesFiltering( context.user_data[_USER_DATE_GAMES_FILTER_KEY]).filter_games() top = games.players.most_captains[0:10] top_players_html_text = transform_players_with_amount_to_telegram_html_text( top) query = update.callback_query query.edit_message_text( parse_mode=ParseMode.HTML, text=f"השחקנים שהיו קפטן הכי הרבה פעמים: \n{top_players_html_text}") return go_to_more_stats_or_finish_menu(update, context)
def show_players_winning_streaks_action(update, context): games = MaccabiGamesFiltering( context.user_data[_USER_DATE_GAMES_FILTER_KEY]).filter_games() top = games.players_streaks.get_players_with_best_win_streak() top_players_html_text = transform_players_with_maccabi_games_to_telegram_html_text( top) query = update.callback_query query.edit_message_text( parse_mode=ParseMode.HTML, text=f"השחקנים עם רצף הנצחונות הארוך ביותר: \n{top_players_html_text}") return go_to_more_stats_or_finish_menu(update, context)