'Module Wavelink Has no attribute Client

import discord
import wavelink
from discord.ext import commands
#Please help me 


class Bot(commands.Bot):

  def __init__(self):
    super(Bot, self).__init__(command_prefix=['audio ', 'wave ','aw '])

    self.add_cog(Music(self))

  async def on_ready(self):
    print(f'Logged in as {self.user.name} | {self.user.id}')


class Music(commands.Cog):

  def __init__(self, bot):
    self.bot = bot

    if not hasattr(bot, 'wavelink'):
        self.bot.wavelink = wavelink.Client(bot=self.bot)

    self.bot.loop.create_task(self.start_nodes())

  async def start_nodes(self):
     await self.bot.wavelink.initiate_node(host='lava.link',
                                          port=2333,
                                          rest_uri='http://lava.link:2333',
                                          password='youshallnotpass',
                                          identifier='TEST',
                                          region='us_east')

  @commands.command(name='connect')
  async def connect_(self, ctx, *, channel: discord.VoiceChannel=None):
    if not chan`enter code here`nel:
        try:
            channel = ctx.author.voice.channel
        except AttributeError:
            raise discord.DiscordException('No channel to join. Please either specify a valid channel or join one.')

    player = self.bot.wavelink.get_player(ctx.guild.id)
    await ctx.send(f'Connecting to **`{channel.name}`**')
    await player.connect(channel.id)

  @commands.command()
  async def play(self, ctx, *, query: str):
    tracks = await self.bot.wavelink.get_tracks(f'ytsearch:{query}')

    if not tracks:
        return await ctx.send('Could not find any songs with that query.')

    player = self.bot.wavelink.get_player(ctx.guild.id)
    if not player.is_connected:
        await ctx.invoke(self.connect_)

    await ctx.send(f'Added {str(tracks[0])} to the queue.')
    await player.play(tracks[0])
    #play music

bot = Bot()
bot.run('TOKEN')

but it is showing an error when running

Traceback (most recent call last): File "/Users/admin/Desktop/Cogs/music2.py", line 62, in bot = Bot() File "/Users/admin/Desktop/Cogs/music2.py", line 11, in init self.add_cog(Music(self)) File "/Users/admin/Desktop/Cogs/music2.py", line 23, in init self.bot.wavelink = wavelink.Client(bot=self.bot) AttributeError: module 'wavelink' has no attribute 'Client'

It would be helpful if anybody help me

Please help me??



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source