mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Refactor loop code to allow usage of asyncio.run
This commit is contained in:
committed by
GitHub
parent
196db33e9f
commit
93af158b0c
@ -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
|
||||
|
Reference in New Issue
Block a user