Fix quote tts
This commit is contained in:
@@ -53,8 +53,8 @@ def text_to_speech(text: str, lang: str = "de") -> (discord.AudioSource, Callabl
|
||||
|
||||
async def connect_and_play(
|
||||
channel: discord.VoiceChannel, source: discord.AudioSource,
|
||||
after_play: Optional[Callable[[discord.DiscordException, discord.VoiceProtocol], Coroutine[Any, Any, Any]]] = None
|
||||
) -> Optional[discord.VoiceProtocol]:
|
||||
after_play: Optional[Callable[[discord.DiscordException, discord.VoiceProtocol], Any]] = None
|
||||
) -> Optional[discord.VoiceClient]:
|
||||
# noinspection PyTypeChecker
|
||||
client: discord.VoiceClient = await channel.connect()
|
||||
after_callback: Optional[Callable[[discord.DiscordException], Any]]
|
||||
@@ -62,8 +62,7 @@ async def connect_and_play(
|
||||
after_callback = None
|
||||
else:
|
||||
def callback(exc: discord.DiscordException) -> Any:
|
||||
loop = asyncio.get_event_loop()
|
||||
return loop.run_until_complete(after_play(exc, client))
|
||||
after_play(exc, client)
|
||||
|
||||
after_callback = callback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user