From efe81a67fb55f9f2a67bb84810be729ed8f09bc3 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 22 May 2024 09:04:37 -0400 Subject: [PATCH] Fix Message.poll not prioritising API data over cached data --- discord/message.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/discord/message.py b/discord/message.py index ea62b87f6..1d1a3c96c 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1839,12 +1839,11 @@ class Message(PartialMessage, Hashable): # This updates the poll so it has the counts, if the message # was previously cached. - self.poll: Optional[Poll] = state._get_poll(self.id) - if self.poll is None: - try: - self.poll = Poll._from_data(data=data['poll'], message=self, state=state) - except KeyError: - pass + self.poll: Optional[Poll] = None + try: + self.poll = Poll._from_data(data=data['poll'], message=self, state=state) + except KeyError: + self.poll = state._get_poll(self.id) try: # if the channel doesn't have a guild attribute, we handle that