From 44099713b06d1aa31f58cb2d93242c9125c3974b Mon Sep 17 00:00:00 2001 From: LightSage Date: Sun, 1 Sep 2024 08:50:51 -0500 Subject: [PATCH] Fix autorole configuration if no configuration exists --- lightning/cogs/config/ui.py | 6 ++++++ poetry.lock | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lightning/cogs/config/ui.py b/lightning/cogs/config/ui.py index 1623f6dc..26ef8851 100644 --- a/lightning/cogs/config/ui.py +++ b/lightning/cogs/config/ui.py @@ -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 diff --git a/poetry.lock b/poetry.lock index 161aafcf..59cd3b5f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -903,7 +903,7 @@ voice = ["PyNaCl (>=1.3.0,<1.6)"] type = "git" url = "https://github.com/Rapptz/discord.py.git" reference = "master" -resolved_reference = "dee5bf65c63fc2feca00d32e5f4a9fa293636291" +resolved_reference = "df4b1c88df741b439e97049e5c92feb969bdd5d3" [[package]] name = "distlib"