mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add support for poll result messages
This commit is contained in:
@ -552,6 +552,27 @@ class ConnectionState(Generic[ClientT]):
|
||||
poll._handle_vote(answer_id, added, self_voted)
|
||||
return poll
|
||||
|
||||
def _update_poll_results(self, from_: Message, to: Union[Message, int]) -> None:
|
||||
if isinstance(to, Message):
|
||||
cached = self._get_message(to.id)
|
||||
elif isinstance(to, int):
|
||||
cached = self._get_message(to)
|
||||
|
||||
if cached is None:
|
||||
return
|
||||
|
||||
to = cached
|
||||
else:
|
||||
return
|
||||
|
||||
if to.poll is None:
|
||||
return
|
||||
|
||||
to.poll._update_results_from_message(from_)
|
||||
|
||||
if cached is not None and cached.poll:
|
||||
cached.poll._update_results_from_message(from_)
|
||||
|
||||
async def chunker(
|
||||
self, guild_id: int, query: str = '', limit: int = 0, presences: bool = False, *, nonce: Optional[str] = None
|
||||
) -> None:
|
||||
|
Reference in New Issue
Block a user