align /getgamers and stats-message tables, unify stats body into one code block
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 31s

- /getgamers: column-aligned monospace table (username, ratings, period).
- Per-mode stats (rating/wins/losses/draws): column-aligned block, dropped
  the meaningless multi-game average accuracy row.
- format_stats_response/format_period_notification now wrap the whole
  message in a single markdown code block instead of alternating
  plain-text headers and separately-fenced tables.
- Rating row gets an emoji prefix to match the other three rows, so
  Telegram's monospace rendering keeps all values in the same column.
This commit is contained in:
vrubelroman 2026-07-03 13:20:50 +00:00
parent 2a7385290e
commit f154d3d7c3
3 changed files with 113 additions and 76 deletions

View file

@ -94,8 +94,11 @@ TRANSLATIONS = {
'no_data': "📭 No data",
'stats_title': "📊 Statistics {username}{date_range}\n\n",
'puzzles_section': "🧩 Puzzles: {total} (✅ {solved} - ❌ {unsolved})\n\n",
'games_section': "{emoji} {game_type}{games_count} games • {rating_change}\nRating: {rating}\n✅ Wins: {wins}\n❌ Losses: {losses}\n🤝 Draws: {draws}\n\n",
'games_section_with_accuracy': "{emoji} {game_type}{games_count} games • {rating_change}\nRating: {rating}\n✅ Wins: {wins}\n❌ Losses: {losses}\n🤝 Draws: {draws}\n🎯 Accuracy: {accuracy}\n\n",
'game_type_header': "{emoji} {game_type}{games_count} games • {rating_change}\n",
'stat_label_rating': "⭐ Rating:",
'stat_label_wins': "✅ Wins:",
'stat_label_losses': "❌ Losses:",
'stat_label_draws': "🤝 Draws:",
'game_rows_heading': "{emoji} {game_type} games:\n",
# Set period
@ -112,7 +115,6 @@ TRANSLATIONS = {
'period_minutes_text': "for {period} minutes",
'period_notification_title': "📊 Statistics {username}{period_text}\n\n",
'period_puzzles_section': "🧩 Puzzles: {total} (✅ {solved} - ❌ {failed})\n\n",
'period_games_section': "{emoji} {game_type}{games_count} games • {rating_change}\nRating: {rating}\n✅ Wins: {wins}\n❌ Losses: {losses}\n🤝 Draws: {draws}\n\n",
'no_activity': "📭 No activity for this period",
# Last year or 1000 games
@ -233,8 +235,11 @@ TRANSLATIONS = {
'no_data': "📭 Нет данных",
'stats_title': "📊 Статистика {username}{date_range}\n\n",
'puzzles_section': "🧩 Пазлы: {total} (✅ {solved} - ❌ {unsolved})\n\n",
'games_section': "{emoji} {game_type}{games_count} игр • {rating_change}\nРейтинг: {rating}\n✅ Побед: {wins}\n❌ Поражений: {losses}\n🤝 Ничьих: {draws}\n\n",
'games_section_with_accuracy': "{emoji} {game_type}{games_count} игр • {rating_change}\nРейтинг: {rating}\n✅ Побед: {wins}\n❌ Поражений: {losses}\n🤝 Ничьих: {draws}\n🎯 Точность: {accuracy}\n\n",
'game_type_header': "{emoji} {game_type}{games_count} игр • {rating_change}\n",
'stat_label_rating': "⭐ Рейтинг:",
'stat_label_wins': "✅ Побед:",
'stat_label_losses': "❌ Поражений:",
'stat_label_draws': "🤝 Ничьих:",
'game_rows_heading': "{emoji} Партии {game_type}:\n",
# Set period
@ -251,7 +256,6 @@ TRANSLATIONS = {
'period_minutes_text': "за {period} минут",
'period_notification_title': "📊 Статистика {username}{period_text}\n\n",
'period_puzzles_section': "🧩 Пазлы: {total} (✅ {solved} - ❌ {failed})\n\n",
'period_games_section': "{emoji} {game_type}{games_count} игр • {rating_change}\nРейтинг: {rating}\n✅ Побед: {wins}\n❌ Поражений: {losses}\n🤝 Ничьих: {draws}\n\n",
'no_activity': "📭 Нет активности за этот период",
# Last year or 1000 games