How to use wavelink with slash command

Viewed 24

Hi I'm trying to make a music bot with slash commands with wavelink and whenever I try to make a slash command it says

unsupported type annotation <class 'wavelink.tracks.YouTubeTrack'>

And the command

**async def play(self, interaction: Interaction, search: wavelink.YouTubeTrack):
    await interaction.response.send_message("playing music")
    vc = self.client.voice_clients
    if not vc:
        custom_player = ZbotPlayer
        vc: ZbotPlayer = await interaction.user.voice.channel.connect(cls=custom_player)
        await interaction.response.send_message("Bot connected")
        
    if vc.is_playing():
        vc.queue.put(item=search)
        await self.client.get_channel(interaction.channel_id).send(embed=discord.Embed(title=search.title, url=search.uri, author=interaction.user, description=f"Queued {search.title}, in {vc.channel}"))
    else:
        await vc.play(search)
        await self.client.get_channel(interaction.channel_id).send(embed=discord.Embed(title=search.title, url=search.uri, author=interaction.user, description=f"Queued {search.title}, in {vc.channel}"))
        **
0 Answers
Related