繁体   English   中英

ctx.voice_client.play 不播放音乐 — Discord.py

[英]ctx.voice_client.play not playing music — Discord.py

在这里,我正在尝试制作一个音乐机器人。 目前我的机器人连接到语音通道但不播放任何内容。 ctx.voice_client.play什么都不做,也不会产生任何错误。

这些是我尝试过的试验,但没有奏效。 问题是什么?

ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3'))
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe'))
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', before_options = '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', options = '-vn'))
ffmpeg_options = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', **ffmpeg_options))

在这里,我正在尝试制作一个音乐机器人。 目前我的机器人连接到语音通道但不播放任何内容。 ctx.voice_client.play什么都不做,也不会产生任何错误。

这些是我尝试过的试验,但没有奏效。 问题是什么?

ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3'))
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe'))
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', before_options = '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', options = '-vn'))
ffmpeg_options = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', **ffmpeg_options))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM