file not found error
This commit is contained in:
5
bot.py
5
bot.py
@ -224,11 +224,12 @@ class HeidiClient(discord.Client):
|
|||||||
soundfile = message.content.split(" ")[-1]
|
soundfile = message.content.split(" ")[-1]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
audio_source = discord.FFmpegPCMAudio("/sounds/" + soundfile + ".mp3") # only works from docker
|
open("/sounds/" + soundfile + ".mp3")
|
||||||
except AttributeError:
|
except IOError:
|
||||||
print("Error: Invalid soundfile!")
|
print("Error: Invalid soundfile!")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
audio_source = discord.FFmpegPCMAudio("/sounds/" + soundfile + ".mp3") # only works from docker
|
||||||
voice_client = await voice_channel.connect()
|
voice_client = await voice_channel.connect()
|
||||||
voice_client.play(audio_source)
|
voice_client.play(audio_source)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user