From e9abc7befd70b697ada48ddf3c6d70b354a76c79 Mon Sep 17 00:00:00 2001 From: kevroded Date: Tue, 5 Jan 2021 23:52:23 -0500 Subject: [PATCH] First try at adding weather to game history command --- database.py | 3 ++- main_controller.py | 3 ++- the_prestige.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/database.py b/database.py index 831c496..11db634 100644 --- a/database.py +++ b/database.py @@ -71,7 +71,8 @@ def initialcheck(): Team_1 text NOT NULL, Team_1_Score integer, Team_2 text NOT NULL, - Team_2_Score integer + Team_2_Score integer, + Weather text NOT NULL );""" if conn is not None: diff --git a/main_controller.py b/main_controller.py index b38a62e..0e987c6 100644 --- a/main_controller.py +++ b/main_controller.py @@ -64,7 +64,8 @@ def update_loop(): if state["update_pause"] == 1: state["update_emoji"] = "🍿" if this_game.over: - db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score) + db.cache_history(this_game.teams['home'].name, this_game.teams["home"].score, this_game.teams['away'].name, this_game.teams['away'].score, + this_game.weather_text) state["display_inning"] -= 1 state["display_top_of_inning"] = False winning_team = this_game.teams['home'].name if this_game.teams['home'].score > this_game.teams['away'].score else this_game.teams['away'].name diff --git a/the_prestige.py b/the_prestige.py index a175fa5..20d0cd0 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -1175,7 +1175,7 @@ async def history_pages(msg, all_games, search_term=None): embed.set_footer(text = f"Page {page+1} of {page_max}") for i in range(0,25): try: - embed.add_field(name=str(all_games[i+25*page]["Team1"])+' at '+str(all_games[i+25*page]["Team2"]), value=str(all_games[i+25*page]["Team1Score"])+' to '+str(all_games[i+25*page]["Team2Score"])) + embed.add_field(name=str(all_games[i+25*page]["Team1"])+' at '+str(all_games[i+25*page]["Team2"]), value=str(all_games[i+25*page]["Team1Score"])+' to '+str(all_games[i+25*page]["Team2Score"]) + '\nWeather: '+str(all_games[i+25*page]['Weather'])) except: break pages.append(embed)