Fix quote tts
This commit is contained in:
9
bot.py
9
bot.py
@@ -795,11 +795,12 @@ async def quote_random_slash(ctx: SlashContext, author: Optional[str] = None, tt
|
||||
if tts:
|
||||
voice: discord.VoiceState = ctx.author.voice
|
||||
if voice.channel is not None:
|
||||
async def after_play(e: discord.DiscordException, vp: discord.VoiceProtocol):
|
||||
await vp.disconnect(force=True)
|
||||
source, tts_destroyer = text_to_speech(author + " sagte: " + quote)
|
||||
vp: discord.VoiceClient = await connect_and_play(voice.channel, source)
|
||||
while vp.is_playing() and vp.channel == voice.channel:
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
source, tts_destroyer = text_to_speech(quote)
|
||||
await connect_and_play(voice.channel, source, after_play=after_play)
|
||||
await vp.disconnect()
|
||||
tts_destroyer()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user