Repository: Pycord-Development/pycord

Issue:
Unable to edit PartialMessage's embed on 2.0.0b5
### Summary

I am unable to edit a PartialMessage's embed on Pycord's 2.0.0b5 version, although editing the content works.

### Reproduction Steps

1) Send a message
2) Get the partial message through get_partial_message(message id)
3) edit the partial message with `.edit(embed=embed)`

### Minimal Reproducible Code

```python
import asyncio
embed = discord.Embed(title="Alpha")
msg = await ctx.send("Alpha", embed=embed)
await asyncio.sleep(1.0)
partialmsg = ctx.channel.get_partial_message(msg.id)
embed.title = "Bravo"
await partialmsg.edit(content = "Bravo", embed=embed)
```


### Expected Results

When editing the message, both the content and the embed gets edited.

### Actual Results

Only the content got edited. If you only pass `embed` and not `content`, the same thing happens.

### Intents

discord.Intents(guilds = True, members = True, presences = True, messages = True, reactions = True, emojis = True, invites = True, voice_states = True, message_content = True)

### System Information

- Python v3.8.10-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b5
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000


### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

Editing the partial message still works on 2.0.0b4 and lower.

Here's a video: https://cdn.discordapp.com/attachments/871737314831908974/954658593217585172/2022-03-19_16-30-36.mp4
Unable to edit PartialMessage's embed on 2.0.0b5
### Summary

I am unable to edit a PartialMessage's embed on Pycord's 2.0.0b5 version, although editing the content works.

### Reproduction Steps

1) Send a message
2) Get the partial message through get_partial_message(message id)
3) edit the partial message with `.edit(embed=embed)`

### Minimal Reproducible Code

```python
import asyncio
embed = discord.Embed(title="Alpha")
msg = await ctx.send("Alpha", embed=embed)
await asyncio.sleep(1.0)
partialmsg = ctx.channel.get_partial_message(msg.id)
embed.title = "Bravo"
await partialmsg.edit(content = "Bravo", embed=embed)
```


### Expected Results

When editing the message, both the content and the embed gets edited.

### Actual Results

Only the content got edited. If you only pass `embed` and not `content`, the same thing happens.

### Intents

discord.Intents(guilds = True, members = True, presences = True, messages = True, reactions = True, emojis = True, invites = True, voice_states = True, message_content = True)

### System Information

- Python v3.8.10-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b5
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000


### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

Editing the partial message still works on 2.0.0b4 and lower.

Here's a video: https://cdn.discordapp.com/attachments/871737314831908974/954658593217585172/2022-03-19_16-30-36.mp4


Discussion:
Ran into this same issue today which is what led me here. No attempts to push embed changes via the .edit method of a partial message appear to work in b5.
Just found out setting `discord.http.API_VERSION = 9` is a workaround for this problem, so I'm assuming it's a problem with the HTTP state/API?
Ran into this same issue today which is what led me here. No attempts to push embed changes via the .edit method of a partial message appear to work in b5.
Just found out setting `discord.http.API_VERSION = 9` is a workaround for this problem, so I'm assuming it's a problem with the HTTP state/API?

Resolving patch:
diff --git a/discord/abc.py b/discord/abc.py
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -1434,11 +1434,11 @@ async def send(
 
         if allowed_mentions is None:
             allowed_mentions = state.allowed_mentions and state.allowed_mentions.to_dict()
-
         elif state.allowed_mentions is not None:
             allowed_mentions = state.allowed_mentions.merge(allowed_mentions).to_dict()
         else:
             allowed_mentions = allowed_mentions.to_dict()
+
         if mention_author is not None:
             allowed_mentions = allowed_mentions or AllowedMentions().to_dict()
             allowed_mentions["replied_user"] = bool(mention_author)
diff --git a/discord/message.py b/discord/message.py
--- a/discord/message.py
+++ b/discord/message.py
@@ -1814,8 +1814,6 @@ async def edit(self, **fields: Any) -> Optional[Message]:
 
         Edits the message.
 
-        The content must be able to be transformed into a string via ``str(content)``.
-
         .. versionchanged:: 1.7
             :class:`discord.Message` is returned instead of ``None`` if an edit took place.
 
@@ -1824,9 +1822,13 @@ async def edit(self, **fields: Any) -> Optional[Message]:
         content: Optional[:class:`str`]
             The new content to replace the message with.
             Could be ``None`` to remove the content.
-        embed: Optional[:class:`Embed`]
+        embed: Optional[:class:`~discord.Embed`]
             The new embed to replace the original with.
             Could be ``None`` to remove the embed.
+        embeds: Optional[List[:class:`~discord.Embed`]]
+            A list of embeds to upload. Must be a maximum of 10.
+
+            .. versionadded:: 2.0
         suppress: :class:`bool`
             Whether to suppress embeds for the message. This removes
             all the embeds if set to ``True``. If set to ``False``
@@ -1865,53 +1867,43 @@ async def edit(self, **fields: Any) -> Optional[Message]:
             The message that was edited.
         """
 
-        try:
-            content = fields["content"]
-        except KeyError:
-            pass
-        else:
-            if content is not None:
-                fields["content"] = str(content)
+        content = fields.pop("content", MISSING)
+        if content is not MISSING:
+            fields["content"] = str(content)
 
-        try:
-            embed = fields["embed"]
-        except KeyError:
-            pass
-        else:
-            if embed is not None:
-                fields["embed"] = embed.to_dict()
+        embed = fields.pop("embed", MISSING)
+        embeds = fields.pop("embeds", MISSING)
 
-        try:
-            suppress: bool = fields.pop("suppress")
-        except KeyError:
-            pass
-        else:
-            flags = MessageFlags._from_value(0)
-            flags.suppress_embeds = suppress
-            fields["flags"] = flags.value
+        if embed is not MISSING and embeds is not MISSING:
+            raise InvalidArgument("Cannot pass both embed and embeds parameters.")
+
+        if embed is not MISSING:
+            fields["embeds"] = [embed.to_dict()]
+
+        if embeds is not MISSING:
+            fields["embeds"] = [embed.to_dict() for embed in embeds]
+
+        suppress = fields.pop("suppress", False)
+        flags = MessageFlags._from_value(0)
+        flags.suppress_embeds = suppress
+        fields["flags"] = flags.value
 
         delete_after = fields.pop("delete_after", None)
 
-        try:
-            allowed_mentions = fields.pop("allowed_mentions")
-        except KeyError:
-            pass
+        allowed_mentions = fields.get("allowed_mentions", MISSING)
+        if allowed_mentions is not MISSING:
+            if self._state.allowed_mentions is not None:
+                allowed_mentions = self._state.allowed_mentions.merge(allowed_mentions).to_dict()
+            else:
+                allowed_mentions = allowed_mentions.to_dict()
+            fields["allowed_mentions"] = allowed_mentions
         else:
-            if allowed_mentions is not None:
-                if self._state.allowed_mentions is not None:
-                    allowed_mentions = self._state.allowed_mentions.merge(allowed_mentions).to_dict()
-                else:
-                    allowed_mentions = allowed_mentions.to_dict()
-                fields["allowed_mentions"] = allowed_mentions
+            fields["allowed_mentions"] = self._state.allowed_mentions.to_dict() if self._state.allowed_mentions else None
+
+        view = fields.pop("view", None)
+        self._state.prevent_view_updates_for(self.id)
+        fields["components"] = view.to_components() if view else []
 
-        try:
-            view = fields.pop("view")
-        except KeyError:
-            # To check for the view afterwards
-            view = None
-        else:
-            self._state.prevent_view_updates_for(self.id)
-            fields["components"] = view.to_components() if view else []
         if fields:
             data = await self._state.http.edit_message(self.channel.id, self.id, **fields)
 


Test patch: