Catch keyerror, reported to NAFF

This commit is contained in:
Zeva Rose 2022-05-05 10:23:08 -06:00
parent 4599bd31bd
commit 04561838e1
2 changed files with 5 additions and 2 deletions

View file

@ -219,7 +219,10 @@ class SettingsCog(Cog):
async for setting in settings:
value = setting.value
if setting.setting in ["unverified", "verified", "mute"]:
value = await ctx.guild.fetch_role(value)
try:
value = await ctx.guild.fetch_role(value)
except KeyError:
value = None
if value:
value = value.mention
else:

View file

@ -151,7 +151,7 @@ async def update(bot: "Client") -> Optional[UpdateResult]:
for module in current_commands.keys():
if module not in new_commands:
logger.debug("Module %s removed after update", module)
bot.shed_cog(module)
bot.drop_cog(module)
unloaded.append(module)
logger.debug("Checking for new/modified commands")