Skip to content

Commit

Permalink
Update Polls event docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DA-344 committed May 30, 2024
1 parent d18f14c commit 205ddaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion discord/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,12 @@ def expires_at(self) -> Optional[datetime.datetime]:

@property
def created_at(self) -> Optional[datetime.datetime]:
""":class:`datetime.datetime`: Returns the poll's creation time, or ``None`` if user-created."""
"""Optional[:class:`datetime.datetime`]: Returns the poll's creation time.
.. note::
This will **always** be ``None`` for stateless polls.
"""

if not self._message:
return
Expand Down
9 changes: 7 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,8 @@ Polls
.. function:: on_poll_vote_add(user, answer)
on_poll_vote_remove(user, answer)

Called when a :class:`Poll` gains or loses a vote. If the ``user`` or ``message``
are not cached then this event will not be called.
Called when a :class:`Poll` gains or loses a vote. If the ``user`` or ``answer``'s poll
parent message are not cached then this event will not be called.

This requires :attr:`Intents.message_content` and :attr:`Intents.polls` to be enabled.

Expand All @@ -1078,6 +1078,11 @@ Polls

This requires :attr:`Intents.message_content` and :attr:`Intents.polls` to be enabled.

.. note::

If the poll allows multiple answers and the user removes or adds multiple votes, this
event will be called as many times as votes that are added or removed.

.. versionadded:: 2.4

:param payload: The raw event payload data.
Expand Down

0 comments on commit 205ddaf

Please sign in to comment.