corpnewt / CorpBot.py

A very clumsy python bot for discord
MIT License
194 stars 91 forks source link

Music is not working #88

Closed BaroDevelopment closed 4 years ago

BaroDevelopment commented 4 years ago

When i use the play command i get this error

Ignoring exception in command play:
Traceback (most recent call last):
  File "E:\Programme\Python\lib\site-packages\discord\ext\commands\core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 350, in play
    await self.resolve_search(ctx, url)
  File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 83, in resolve_search
    data = await self.add_to_queue(ctx, url, shuffle)
  File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 115, in add_to_queue
    tracks = await self.bot.wavelink.get_tracks(url)
  File "E:\Programme\Python\lib\site-packages\wavelink\client.py", line 100, in get_tracks
    return await node.get_tracks(query)
AttributeError: 'NoneType' object has no attribute 'get_tracks'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\Programme\Python\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "E:\Programme\Python\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "E:\Programme\Python\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'get_tracks'
corpnewt commented 4 years ago

I recently migrated the play function to use Lavalink via the wavelink wrapper. It now expects a local Lavalink server setup to play music.

In the error you pasted, the node is None - which means that wavelink returned a NoneType here.

Let me know if setting up a local Lavalink server fixed the issue.

-CorpNewt

corpnewt commented 4 years ago

I'm going to close the issue for the time being - if that doesn't solve it for you, feel free to respond and I'll reopen it.

-CorpNewt