Skip to content

Commit

Permalink
Fix autorole configuration if no configuration exists
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Sep 1, 2024
1 parent 85e2fe9 commit 4409971
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lightning/cogs/config/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ async def format_initial_message(self, ctx):
record = await ctx.bot.get_guild_bot_config(ctx.guild.id)
embed = discord.Embed(title="Auto Role Configuration", color=0xf74b06)

if not record:
self.remove_autorole_button.disabled = True
self.add_autorole_button.label = "Add an autorole"
embed.description = "This server has not setup an autorole yet."
return embed

if record.autorole:
self.add_autorole_button.label = "Change autorole"
self.remove_autorole_button.disabled = False
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4409971

Please sign in to comment.