From 2a19e47b5f98de08c185b1e4e99c25e8d31609db Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 4 Feb 2021 02:54:15 -0500 Subject: [PATCH] fixed bug with no players meeting min stat requirements for stats --- the_prestige.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/the_prestige.py b/the_prestige.py index 0241f9d..b5fdad4 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -889,7 +889,12 @@ class LeagueLeadersCommand(Command): if league_exists(command.split("\n")[0].strip()): league = leagues.load_league_file(command.split("\n")[0].strip()) stat_name = command.split("\n")[1].strip() - stat_embed = league.stat_embed(stat_name) + try: + stat_embed = league.stat_embed(stat_name) + except IndexError: + await msg.channel.send("Nobody's played enough games to get meaningful stats in that category yet, chief. Try again after the next game or two.") + return + if stat_embed is None: await msg.channel.send("We don't know what that stat is, chief.") return