From f67eb75c7ba651101c04acdc7054820a87f2d6fc Mon Sep 17 00:00:00 2001 From: alwayscompiling Date: Thu, 4 Aug 2022 10:29:14 -0400 Subject: [PATCH] Add warning for posting without tables. --- cogs/post_highscores/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cogs/post_highscores/__init__.py b/cogs/post_highscores/__init__.py index 601ed0b..a6ba967 100644 --- a/cogs/post_highscores/__init__.py +++ b/cogs/post_highscores/__init__.py @@ -35,6 +35,12 @@ class PostHighscores(commands.Cog, name="Post Highscores"): error_response += 'Register with "?register" command.' assert channel is not None, await ctx.send(error_response) + if len(highscores_data.get_guild(ctx.guild.id).tables) < 1: + await channel.send( + "No tables have been created for this guild. Please create some tables." + ) + return + for table in highscores_data.get_guild(ctx.guild.id).tables: message: nextcord.Message = await send_highscore_message(channel, guild, table) await message.edit(view=SubmissionCreateButton(self.bot))