diff --git a/wavelink/player.py b/wavelink/player.py index d961ccb7..3f0d1fd2 100644 --- a/wavelink/player.py +++ b/wavelink/player.py @@ -169,8 +169,13 @@ def __init__( self._inactivity_wait: int | None = self._node._inactive_player_timeout def _inactivity_task_callback(self, task: asyncio.Task[bool]) -> None: - result: bool = task.result() - cancelled: bool = task.cancelled() + cancelled: bool = False + + try: + result: bool = task.result() + except asyncio.CancelledError: + cancelled = True + result = False if cancelled or result is False: logger.debug("Disregarding Inactivity Check Task <%s> as it was previously cancelled.", task.get_name())