Code
@bot.slash_command(name="play" , description="Plays Songs")
async def play(ctx, url : str):
song_there = os.path.isfile("song.mp3")
try:
if song_there:
os.remove("song.mp3")
except PermissionError:
await ctx.send("Wait for the current playing music to end or use the 'stop' command")
return
voiceChannel = discord.utils.get(ctx.guild.voice_channels, name='General')
print(voiceChannel)
await voiceChannel.connect()
voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)
song=ytaudio(url)
voice.play(discord.FFmpegPCMAudio(song))
I don't get what I am doing wrong here
