簡體   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