From edf5a0ba1f8e06ab72549d8e7b6853d3a9a36c47 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Fri, 22 Apr 2022 02:05:48 +0100 Subject: [PATCH] Add check for when there's no tables to delete --- exclamation_mark_charity/modules/tournament/cog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exclamation_mark_charity/modules/tournament/cog.py b/exclamation_mark_charity/modules/tournament/cog.py index fbd993d..225f1a7 100644 --- a/exclamation_mark_charity/modules/tournament/cog.py +++ b/exclamation_mark_charity/modules/tournament/cog.py @@ -117,6 +117,10 @@ class Tournament(interactions.Extension): success, all_tournaments = Database.view_all_tournaments() tables = [table[0] for table in all_tournaments[1:]] + if not tables: + await ctx.send("No Tables To Delete!") + return + menu = interactions.SelectMenu( custom_id="tournament_deletes_menu", options=[interactions.SelectOption(label=table, value=table) for table in tables],