diff options
| author | Rapptz <[email protected]> | 2019-06-07 22:18:01 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-06-07 22:18:01 -0400 |
| commit | f84219c2b2f94133ea1d7989c50547042dc7145e (patch) | |
| tree | 788d3cdc844f4771e545c5cb34cf681ae1969c0e /discord/state.py | |
| parent | Improve documentation (diff) | |
| download | discord.py-f84219c2b2f94133ea1d7989c50547042dc7145e.tar.xz discord.py-f84219c2b2f94133ea1d7989c50547042dc7145e.zip | |
Improve performance of parsing MESSAGE_UPDATE and MESSAGE_CREATE events
Embed edits are no longer special cased in the dispatch code, which
could lead to on_message_edit being called more often than it used to
be called. I am not sure on the general impact on that being removed.
Fixes #2195
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/discord/state.py b/discord/state.py index d56b9e75..bbee44a8 100644 --- a/discord/state.py +++ b/discord/state.py @@ -397,15 +397,7 @@ class ConnectionState: older_message = copy.copy(message) raw.cached_message = older_message self.dispatch('raw_message_edit', raw) - if 'call' in data: - # call state message edit - message._handle_call(data['call']) - elif 'content' not in data: - # embed only edit - message.embeds = [Embed.from_dict(d) for d in data['embeds']] - else: - message._update(channel=message.channel, data=data) - + message._update(data) self.dispatch('message_edit', older_message, message) else: self.dispatch('raw_message_edit', raw) |