From d34efcad4b18fe12db123af7dcc4ac84ca3f41db Mon Sep 17 00:00:00 2001 From: Genderdruid Date: Fri, 8 Jan 2021 10:10:01 -0800 Subject: [PATCH 1/5] a few minor text updates --- README.md | 4 ++-- the_prestige.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 33d9fef..a670c83 100644 --- a/README.md +++ b/README.md @@ -70,12 +70,12 @@ accepting pull requests, check the issues for to-dos. - use this command at the top of a list with entries separated by new lines: - the away team's name. - the home team's name. - - optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9. + - optionally, the number of innings, which must be greater than 2 and less than 201. if not included it will default to 9. - this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for. - m;randomgame - starts a 9-inning game between 2 entirely random teams. embrace chaos! - m;starttournament --rounddelay # - - starts a randomly seeded tournament with up to 64 provided teams, automatically adding byes as necessary. all series have a 5 minute break between games. the current format is: best of 5 until the finals which are best of 7. + - starts a randomly seeded tournament with the provided teams, automatically adding byes as necessary. all series have a 5 minute break between games. the current format is: best of 5 until the finals which are best of 7. - the --rounddelay is optional, if used, # must be between 1 and 120 and it'll set the delay between rounds to be # minutes. if not included it will default to 10. - use this command at the top of a list with entries separated by new lines: - the name of the tournament. diff --git a/the_prestige.py b/the_prestige.py index fa0206d..2f2365c 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -119,10 +119,11 @@ class ShowPlayerCommand(Command): class StartGameCommand(Command): name = "startgame" template = "m;startgame [away] [home] [innings]" - description ="""Starts a game with premade teams made using saveteam, use this command at the top of a list followed by each of these in a new line (shift+enter in discord, or copy+paste from notepad) (this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for.): + description ="""Starts a game with premade teams made using saveteam, use this command at the top of a list followed by each of these in a new line (shift+enter in discord, or copy+paste from notepad): - the away team's name. - the home team's name. - - and finally, optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9.""" + - and finally, optionally, the number of innings, which must be greater than 2 and less than 201. if not included it will default to 9. + - this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for.)""" async def execute(self, msg, command): league = None @@ -500,7 +501,7 @@ class StartTournamentCommand(Command): template = """m;starttournament [tournament name] [list of teams, each on a new line]""" - description = "Starts a randomly seeded tournament with up to 64 provided teams, automatically adding byes as necessary. All series have a 5 minute break between games and by default there is a 10 minute break between rounds. The current tournament format is:\nBest of 5 until the finals, which are Best of 7." + description = "Starts a randomly seeded tournament with the provided teams, automatically adding byes as necessary. All series have a 5 minute break between games and by default there is a 10 minute break between rounds. The current tournament format is:\nBest of 5 until the finals, which are Best of 7." async def execute(self, msg, command): if config()["game_freeze"]: From ad6cc90e821736b82f1f82cd91370416d8b51971 Mon Sep 17 00:00:00 2001 From: Genderdruid Date: Fri, 8 Jan 2021 10:15:50 -0800 Subject: [PATCH 2/5] Update the_prestige.py --- the_prestige.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the_prestige.py b/the_prestige.py index 2f2365c..ddb0267 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -123,7 +123,7 @@ class StartGameCommand(Command): - the away team's name. - the home team's name. - and finally, optionally, the number of innings, which must be greater than 2 and less than 201. if not included it will default to 9. - - this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for.)""" + - this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for.""" async def execute(self, msg, command): league = None From 0a1f1a9e731cf5407209e3321e8266a722ef72b2 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Fri, 8 Jan 2021 13:55:52 -0500 Subject: [PATCH 3/5] added connection closing statements to most database.py functions --- database.py | 17 +++++++++++++++-- the_prestige.py | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/database.py b/database.py index d10a056..1dd1c90 100644 --- a/database.py +++ b/database.py @@ -186,9 +186,13 @@ def get_user_player_conn(conn, user): except TypeError: return False else: - print(conn) + conn.close() + return False except: - print(conn) + conn.close() + return False +conn.close() +return False def get_user_player(user): conn = create_connection() @@ -211,6 +215,8 @@ def save_team(name, team_json_string, user_id): return False except: return False + conn.close() + return False def update_team(name, team_json_string): conn = create_connection() @@ -225,7 +231,10 @@ def update_team(name, team_json_string): conn.close() return False except: + conn.close() return False + conn.close() + return False def get_team(name, owner=False): conn = create_connection() @@ -258,6 +267,8 @@ def delete_team(team): except: conn.close() return False + conn.close() + return False def assign_owner(team_name, owner_id): conn = create_connection() @@ -271,6 +282,8 @@ def assign_owner(team_name, owner_id): except: conn.close() return False + conn.close() + return False def get_all_teams(): conn = create_connection() diff --git a/the_prestige.py b/the_prestige.py index fa0206d..5a70a76 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -489,7 +489,6 @@ class AssignOwnerCommand(Command): async def execute(self, msg, command): new_owner = msg.mentions[0] team_name = command.strip().split(new_owner.mention+" ")[1] - print(team_name) if db.assign_owner(team_name, new_owner.id): await msg.channel.send(f"{team_name} is now owned by {new_owner.display_name}. Don't break it.") else: From 7e3b1d353f4755cf3ab6851b9f57a8f9e7f70027 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Fri, 8 Jan 2021 13:56:36 -0500 Subject: [PATCH 4/5] fixed an error oops --- database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database.py b/database.py index 1dd1c90..6e89b73 100644 --- a/database.py +++ b/database.py @@ -191,8 +191,8 @@ def get_user_player_conn(conn, user): except: conn.close() return False -conn.close() -return False + conn.close() + return False def get_user_player(user): conn = create_connection() From 20a13fdf2e6effac17ec23d6d3198a2597e3bf8e Mon Sep 17 00:00:00 2001 From: Sakimori Date: Sat, 9 Jan 2021 11:55:58 -0500 Subject: [PATCH 5/5] added another patron --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a670c83..343a2fd 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,4 @@ these folks are helping me a *ton* via patreon, and i cannot possibly thank them - Kameleon - Ryan Littleton - Evie Diver +- iliana etaoin