Add warning for posting without tables.
This commit is contained in:
@@ -35,6 +35,12 @@ class PostHighscores(commands.Cog, name="Post Highscores"):
|
|||||||
error_response += 'Register with "?register" command.'
|
error_response += 'Register with "?register" command.'
|
||||||
assert channel is not None, await ctx.send(error_response)
|
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:
|
for table in highscores_data.get_guild(ctx.guild.id).tables:
|
||||||
message: nextcord.Message = await send_highscore_message(channel, guild, table)
|
message: nextcord.Message = await send_highscore_message(channel, guild, table)
|
||||||
await message.edit(view=SubmissionCreateButton(self.bot))
|
await message.edit(view=SubmissionCreateButton(self.bot))
|
||||||
|
|||||||
Reference in New Issue
Block a user