Catch keyerror, reported to NAFF
This commit is contained in:
parent
4599bd31bd
commit
04561838e1
2 changed files with 5 additions and 2 deletions
|
@ -219,7 +219,10 @@ class SettingsCog(Cog):
|
||||||
async for setting in settings:
|
async for setting in settings:
|
||||||
value = setting.value
|
value = setting.value
|
||||||
if setting.setting in ["unverified", "verified", "mute"]:
|
if setting.setting in ["unverified", "verified", "mute"]:
|
||||||
|
try:
|
||||||
value = await ctx.guild.fetch_role(value)
|
value = await ctx.guild.fetch_role(value)
|
||||||
|
except KeyError:
|
||||||
|
value = None
|
||||||
if value:
|
if value:
|
||||||
value = value.mention
|
value = value.mention
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -151,7 +151,7 @@ async def update(bot: "Client") -> Optional[UpdateResult]:
|
||||||
for module in current_commands.keys():
|
for module in current_commands.keys():
|
||||||
if module not in new_commands:
|
if module not in new_commands:
|
||||||
logger.debug("Module %s removed after update", module)
|
logger.debug("Module %s removed after update", module)
|
||||||
bot.shed_cog(module)
|
bot.drop_cog(module)
|
||||||
unloaded.append(module)
|
unloaded.append(module)
|
||||||
|
|
||||||
logger.debug("Checking for new/modified commands")
|
logger.debug("Checking for new/modified commands")
|
||||||
|
|
Loading…
Add table
Reference in a new issue