From 1892eda74ccf3099fa8e27c8cd5490bfcaa1b5e9 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Tue, 23 Feb 2021 00:23:36 -0500 Subject: [PATCH] added missing error handling to oblrival --- the_prestige.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/the_prestige.py b/the_prestige.py index e8a3626..6e2467d 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -1306,8 +1306,12 @@ class OBLSetRivalCommand(Command): description = "Sets your team's OBL rival. Can be changed at any time. Requires ownership." async def execute(self, msg, command): - team_i = get_team_fuzzy_search(command.split("\n")[1].strip()) - team_r = get_team_fuzzy_search(command.split("\n")[2].strip()) + try: + team_i = get_team_fuzzy_search(command.split("\n")[1].strip()) + team_r = get_team_fuzzy_search(command.split("\n")[2].strip()) + except IndexError: + await msg.channel.send("You didn't give us enough lines. Command on the top, your team in the middle, and your rival at the bottom.") + return team, owner_id = games.get_team_and_owner(team_i.name) if team is None or team_r is None: await msg.channel.send("Can't find one of those teams, boss. Typo?")