kaogurai / cogs

Red cogs made for kaogurai
MIT License
13 stars 9 forks source link

[smartlyrics] Error in `lyrics` cmd #16

Closed cool-aid-man closed 1 year ago

cool-aid-man commented 1 year ago

Hey Rayan,

Getting this error from <p>lyrics command. Cog: SmartLyrics

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/dusky/cogs/CogManager/cogs/smartlyrics/smartlyrics.py", line 176, in lyrics
    spotify_id = self.get_user_status_song(ctx.author)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/dusky/cogs/CogManager/cogs/smartlyrics/smartlyrics.py", line 81, in get_user_status_song
    return s.track_id
AttributeError: 'str' object has no attribute 'track_id'

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

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/redenv/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: AttributeError: 'str' object has no attribute 'track_id'

Thanks

Ryan5453 commented 1 year ago

Hi, sorry about that.

Can you confirm if SmartLyrics v2.1.4 fixes this issue?

cool-aid-man commented 1 year ago

Hii Actually it triggered the nonetype config error, after updating yes

Exception in command 'lyrics'
Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/dusky/cogs/CogManager/cogs/smartlyrics/smartlyrics.py", line 186, in lyrics
    lastfm_username = await lastfm_cog.config.user(ctx.author).lastfm_username()
AttributeError: 'NoneType' object has no attribute 'config'

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

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/redenv/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: AttributeError: 'NoneType' object has no attribute 'config'
Ryan5453 commented 1 year ago

God I did a horrible job testing this cog, try v2.1.5

cool-aid-man commented 1 year ago

No worries Always happy to help!

And yes it did fix the issue.

Thanks rayan Have a great night:)

Ryan5453 commented 1 year ago

Perfect! Thanks, you too :)