Fix quote tts

This commit is contained in:
2021-10-07 12:58:08 +02:00
parent c2155376eb
commit f7598cf0a9
2 changed files with 8 additions and 8 deletions

View File

@@ -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