Skip to content

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

Closed

Description

@Spillium

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)

Activity

  1. chillymosh commented on Nov 8, 2023

    @chillymosh
    Contributor

    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

  2. locked and limited conversation to collaborators on Nov 8, 2023
  3. converted this issue into a discussion #250 on Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions