Fix KeyError in [p]muteset role (#4531)

This commit is contained in:
jack1142
2020-10-26 18:55:52 +01:00
committed by GitHub
parent 2413c6abd3
commit eeaac828d9

View File

@@ -656,7 +656,8 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
"""
if not role:
await self.config.guild(ctx.guild).mute_role.set(None)
del self.mute_role_cache[ctx.guild.id]
if ctx.guild.id in self.mute_role_cache:
del self.mute_role_cache[ctx.guild.id]
await self.config.guild(ctx.guild).sent_instructions.set(False)
# reset this to warn users next time they may have accidentally
# removed the mute role