flaree / lastfm-red

LastFM Ported to Red
MIT License
3 stars 3 forks source link

nowplaying - KeyError: 'userloved' #13

Closed tigattack closed 2 years ago

tigattack commented 2 years ago

Traceback:

Exception in command 'fm nowplaying'
Traceback (most recent call last):
  File "/home/redbot/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/redbot/data/cogs/CogManager/cogs/lastfm/nowplaying.py", line 68, in command_nowplaying
    loved = trackdata["track"]["userloved"] == "1"
KeyError: 'userloved'

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

Traceback (most recent call last):
  File "/home/redbot/.local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/redbot/.local/lib/python3.9/site-packages/redbot/core/commands/commands.py", line 832, in invoke
    await super().invoke(ctx)
  File "/home/redbot/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1348, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/redbot/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/redbot/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'userloved'
Ryan5453 commented 2 years ago

Should be fixed now!

tigattack commented 2 years ago

Thanks!