1/19/2023 0 Comments Discord tts voice change![]() ![]() My code does not ask the user for text, instead this code uses the input called after the command. Now onto the code, I will simplify it a bit. So, firstly you should put any imports at the start of your file (Same area you import discord) I am still new to making bots on discord so my code looks like a dumpster fire, I am currently working on fixing/compacting my code. # disconnect after the player has finishedĪwait client.say('User is not in a channel.') Player = vc.create_ffmpeg_player('text.mp3', after=lambda: print('done')) Vc = await client.join_voice_channel(voice_channel) ![]() Tts = gtts.gTTS(str(msg.content), lang="en")Īwait client.say('User is in channel: '+ channel) Msg = await client.wait_for("message", check=check, timeout=120)Īwait ctx.send("Sorry, you didn't reply in time!") Return msg.author = ctx.author and msg.channel = ctx.channel # only play music if user is in a voice channelĪwait ctx.send(f"What do you want to say, type cancel to cancel:") Here is my code so far: def repeat(context): Like the title I need to play a gtts file into a voice channel what is the easiest way to do this? I am using python 3.7.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |