Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Unable to remove embeds from a message #97

Closed
@tiltowait

Description

@tiltowait

Per the dpy docs, await msg.edit(embed=None) is supposed to remove an embed from a message. However, I receive the following error:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/client.py", line 257, in _on_response
    await x.invoke(context, **options)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/cogs.py", line 98, in invoke
    raise ex
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/cogs.py", line 93, in invoke
    await self.callback(self.cog, ctx, *args, **kwargs)
  File "/Users/tiltowait/Developer/inconnu/interface/characters.py", line 104, in delete_character
    await inconnu.delete.prompt(ctx, character)
  File "/Users/tiltowait/Developer/inconnu/inconnu/delete.py", line 28, in prompt
    await msg.edit(embed=None)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/receive.py", line 668, in edit
    self._update(await self._state.http.request(r, json=jsonifyMessage(*args, **fields)))
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/http.py", line 70, in jsonifyMessage
    raise WrongType("embeds", embeds, 'list[discord.Embed]')
discord_ui.errors.WrongType: 'embeds' must be of type list[discord.Embed], not <class 'list'>

Out of curiosity, I tried embeds=None but got a different error:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/client.py", line 257, in _on_response
    await x.invoke(context, **options)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/cogs.py", line 98, in invoke
    raise ex
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/cogs.py", line 93, in invoke
    await self.callback(self.cog, ctx, *args, **kwargs)
  File "/Users/tiltowait/Developer/inconnu/interface/characters.py", line 104, in delete_character
    await inconnu.delete.prompt(ctx, character)
  File "/Users/tiltowait/Developer/inconnu/inconnu/delete.py", line 28, in prompt
    await msg.edit(embeds=None)
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/receive.py", line 668, in edit
    self._update(await self._state.http.request(r, json=jsonifyMessage(*args, **fields)))
  File "/opt/homebrew/lib/python3.9/site-packages/discord_ui/http.py", line 69, in jsonifyMessage
    if not all(isinstance(x, discord.Embed) for x in embeds):
TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions