From f84219c2b2f94133ea1d7989c50547042dc7145e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 7 Jun 2019 22:18:01 -0400 Subject: 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 --- discord/state.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'discord/state.py') 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) -- cgit v1.2.3