Flame442/FlameCogs

[Deepfry] Unable to deepfry avatars

Crossedfall opened this issue · 0 comments

Describe the bug
Using deepfry against a user (with a static profile photo) results in a runtime.

To Reproduce
Use the deepfry command against an avatar

Error code

Exception in command 'deepfry'
Traceback (most recent call last):
  File "/etc/redbot/.pyenv/versions/3.11.3/lib/python3.11/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/redbot/beebot/cogs/CogManager/cogs/deepfry/deepfry.py", line 260, in deepfry
    img, isgif, duration = await self._get_image(ctx, link)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/redbot/beebot/cogs/CogManager/cogs/deepfry/deepfry.py", line 206, in _get_image
    data = await avatar.read()
                 ^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'read'

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

Traceback (most recent call last):
  File "/etc/redbot/.pyenv/versions/3.11.3/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/etc/redbot/.pyenv/versions/3.11.3/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/redbot/.pyenv/versions/3.11.3/lib/python3.11/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'read'