voice.play() параметр after вызывается в начале проигрывания аудио
Параметр after вызывается в начале проигрывания
Бот присоединяется и сразу отключается
Вот код команды:
@bot.command(name='play')
async def play(ctx):
voice = await ctx.message.author.voice.channel.connect()
voice.play(source=discord.FFmpegPCMAudio(executable="ffmpeg.exe", source = 'audio.mp3'), after=await voice.disconnect())
UPD:
При передаче функции возникает ошибка
Traceback (most recent call last):
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\player.py", line 686, in _call_after
self.after(error)
TypeError: disconnect() takes 1 positional argument but 2 were given