由于mp3文件过长,机器人停止运行,试图将比特率更改为低。这是代码
@client.command(pass_context=True)
async def bock(ctx):
await ctx.message.delete()
author = ctx.message.author
channel = author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
voice.play(discord.FFmpegPCMAudio(executable=FFMexec, source="bock.mp3"))#, options = "-analyzeduration 1000000000 -i"
while voice.is_playing():
time.sleep(0.5)
await voice.disconnect()
现在它开始工作了,谢谢你的回答
相关问题 更多 >
编程相关推荐