Fix issues with channel unmutes for mute data from 3.4.x (#6121)

This commit is contained in:
Jakub Kuczys 2023-05-04 06:22:54 +02:00 committed by GitHub
parent c541425b57
commit 5f4b0e853e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,6 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
inside our tasks.
"""
log.debug("Cleaning unmute tasks")
is_debug = log.getEffectiveLevel() <= logging.DEBUG
for task_id in list(self._unmute_tasks.keys()):
task = self._unmute_tasks[task_id]
@ -273,9 +272,8 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
if task.done():
try:
r = task.result()
except Exception:
if is_debug:
log.exception("Dead task when trying to unmute")
except Exception as exc:
log.error("An unexpected error occurred in the unmute task", exc_info=exc)
self._unmute_tasks.pop(task_id, None)
async def _handle_server_unmutes(self):
@ -1868,7 +1866,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
"channel": channel,
"reason": _(MUTE_UNMUTE_ISSUES["already_unmuted"]),
}
if not current_mute["voice_mute"] and voice_mute:
if not current_mute.get("voice_mute", False) and voice_mute:
return {
"success": False,
"channel": channel,