Refactor loop code to allow usage of asyncio.run

This commit is contained in:
Han Seung Min - 한승민
2022-03-13 14:24:14 +05:30
committed by GitHub
parent 196db33e9f
commit 93af158b0c
9 changed files with 44 additions and 136 deletions

View File

@ -222,8 +222,6 @@ class VoiceClient(VoiceProtocol):
The endpoint we are connecting to.
channel: Union[:class:`VoiceChannel`, :class:`StageChannel`]
The voice channel connected to.
loop: :class:`asyncio.AbstractEventLoop`
The event loop that the voice client is running on.
"""
channel: VocalGuildChannel
@ -405,7 +403,7 @@ class VoiceClient(VoiceProtocol):
raise
if self._runner is MISSING:
self._runner = self.loop.create_task(self.poll_voice_ws(reconnect))
self._runner = self.client.loop.create_task(self.poll_voice_ws(reconnect))
async def potential_reconnect(self) -> bool:
# Attempt to stop the player thread from playing early