diff --git a/database.py b/database.py index f59114a..e1881e3 100644 --- a/database.py +++ b/database.py @@ -317,4 +317,10 @@ def cache_history(Team_1, Team_1_Score, Team_2, Team_2_Score): conn.close() def get_history(): - pass + conn = create_connection() + if conn is not None: + c = conn.cursor() + c.execute("SELECT * FROM teams") + history_strings = c.fetchall() + conn.close() + return team_strings diff --git a/games.py b/games.py index 5f58dc3..c604504 100644 --- a/games.py +++ b/games.py @@ -720,6 +720,10 @@ def get_all_teams(): teams.append(this_team) return teams +def get_history(): + for game in db.get_history(): + print(game) + def search_team(search_term): teams = [] for team_pickle in db.search_teams(search_term): diff --git a/the_prestige.py b/the_prestige.py index 178ba7d..a824531 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -315,6 +315,14 @@ class AssignOwnerCommand(Command): await msg.channel.send("We couldn't find that team. Typo?") #except: #await msg.channel.send("We hit a snag. Tell xvi.") +class ShowHistoryCommand(Command): + name = "showhistory" + template = "m;showhistory" + description = "Shows all game history" + + async def execute(self, msg, command): + #list_task = asyncio.create_task(history_pages(msg, game.get_history())) + game.get_history() commands = [ @@ -335,6 +343,7 @@ commands = [ CreditCommand(), RomanCommand(), HelpCommand(), + ShowHistory(), ] client = discord.Client()