PythonistaGuild / Wavelink

A powerful Lavalink library for Discord.py.
https://wavelink.dev
MIT License
389 stars 179 forks source link

TypeError: unsupported type annotation <class 'wavelink.tracks.YouTubeTrack'> #249

Closed glitchplaysgames714 closed 10 months ago

glitchplaysgames714 commented 10 months ago

im trying to make a music bot with discord.py and im getting this error

the error: TypeError: unsupported type annotation <class 'wavelink.tracks.YouTubeTrack'>

the command @client.tree.command(name="play",description="plays the music") async def play(ctx: commands.Context, *, search: wavelink.YouTubeTrack): if not ctx.voice_client: vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player) else: vc: wavelink.Player = await ctx.voice_client

    vc.play(search)
chillymosh commented 10 months ago

What python version are you using? 2.x requires at least 3.10

I'd suggest using wavelink 3 though if this is a fresh bot.

Also you using Client which does not support Commands with Context, but you are also using tree which is for app_commands