diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d14e3309..642c59b2d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) - Updated `valid_locales` to support `in` and `es-419`. ([#2767])(https://github.com/Pycord-Development/pycord/pull/2767) +- Fixed `Message._raw_data` to be updated when the message is edited. + ([#2778](https://github.com/Pycord-Development/pycord/pull/2778)) - Fixed `Webhook.edit` not working with `attachments=[]`. ([#2779])(https://github.com/Pycord-Development/pycord/pull/2779) diff --git a/discord/message.py b/discord/message.py index 55a6bfd6b4..dcfaca0fee 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1024,6 +1024,7 @@ def _update(self, data): continue else: handler(self, value) + self._raw_data[key] = value # clear the cached properties for attr in self._CACHED_SLOTS: diff --git a/discord/state.py b/discord/state.py index 52a9cc0989..1d31d46f9d 100644 --- a/discord/state.py +++ b/discord/state.py @@ -776,6 +776,8 @@ def parse_message_update(self, data) -> None: message = self._get_message(raw.message_id) if message is not None: older_message = copy.copy(message) + # Copy the raw data because copy.copy will keep references to the same object + message._raw_data = copy.deepcopy(message._raw_data) raw.cached_message = older_message self.dispatch("raw_message_edit", raw) message._update(data)