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