Skip to content

Commit

Permalink
Return new instance in Poll.end to avoid inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovetocode2019 committed Dec 28, 2024
1 parent 9806aeb commit 0aec3df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions discord/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,5 @@ async def end(self) -> Self:
if not self._message or not self._state: # Make type checker happy
raise ClientException('This poll has no attached message.')

self._message = await self._message.end_poll()

return self
message = await self._message.end_poll()
return message.poll

0 comments on commit 0aec3df

Please sign in to comment.