Пытался создать музыкального бота, получил ошибку
Вот код:
@bot.event
async def on_message(msg):
if msg.author == bot.user:
return
if msg.content == ".connect":
channel = msg.author.voice.channel
client = await channel.connect()
global in_channel
in_channel = True
if msg.content.startswith(".play -"):
if in_channel:
toplay = msg.content.split("-")[1].strip()
name = os.path.basename(__file__)
source = os.path.abspath(__file__).replace(name, f'audio\\{toplay}.mp3')
audio = discord.FFmpegPCMAudio(executable = source.split(f'\\audio')[0], source = source.split(f'audio\\')[1])
client.play(audio)
Вот такая ошибка: PermissionError: [WinError 5] Отказано в доступе Если надо, могу дать полную ошибку.