Add warning for posting without tables.

This commit is contained in:
alwayscompiling
2022-08-04 10:29:14 -04:00
parent 6f4322bf6a
commit f67eb75c7b
+6
View File
@@ -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))