mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
Fix Message.poll not prioritising API data over cached data
This commit is contained in:
parent
f77ba711ba
commit
efe81a67fb
@ -1839,12 +1839,11 @@ class Message(PartialMessage, Hashable):
|
|||||||
|
|
||||||
# This updates the poll so it has the counts, if the message
|
# This updates the poll so it has the counts, if the message
|
||||||
# was previously cached.
|
# was previously cached.
|
||||||
self.poll: Optional[Poll] = state._get_poll(self.id)
|
self.poll: Optional[Poll] = None
|
||||||
if self.poll is None:
|
|
||||||
try:
|
try:
|
||||||
self.poll = Poll._from_data(data=data['poll'], message=self, state=state)
|
self.poll = Poll._from_data(data=data['poll'], message=self, state=state)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
self.poll = state._get_poll(self.id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# if the channel doesn't have a guild attribute, we handle that
|
# if the channel doesn't have a guild attribute, we handle that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user