Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` do be updated when the message is edited.
([#2778](https://github.com/Pycord-Development/pycord/pull/2778))

### Changed

Expand Down
1 change: 1 addition & 0 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down