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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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