mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
Some docs fixes for polls
This commit is contained in:
parent
2f479b2ac6
commit
9d979d3df1
@ -807,6 +807,10 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
then it is silently ignored.
|
then it is silently ignored.
|
||||||
|
|
||||||
.. versionadded:: 2.1
|
.. versionadded:: 2.1
|
||||||
|
poll: :class:`~discord.Poll`
|
||||||
|
The poll to send with this message.
|
||||||
|
|
||||||
|
.. versionadded:: 2.4
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
-------
|
-------
|
||||||
|
@ -202,7 +202,7 @@ class PollAnswer:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def poll(self) -> Poll:
|
def poll(self) -> Poll:
|
||||||
""":class:`Poll`: Returns the parent poll of this answer"""
|
""":class:`Poll`: Returns the parent poll of this answer."""
|
||||||
return self._poll
|
return self._poll
|
||||||
|
|
||||||
def _to_dict(self) -> PollAnswerPayload:
|
def _to_dict(self) -> PollAnswerPayload:
|
||||||
@ -310,7 +310,7 @@ class Poll:
|
|||||||
The duration of the poll. Duration must be in hours.
|
The duration of the poll. Duration must be in hours.
|
||||||
multiple: :class:`bool`
|
multiple: :class:`bool`
|
||||||
Whether users are allowed to select more than one answer.
|
Whether users are allowed to select more than one answer.
|
||||||
Defaultsto ``False``.
|
Defaults to ``False``.
|
||||||
layout_type: :class:`PollLayoutType`
|
layout_type: :class:`PollLayoutType`
|
||||||
The layout type of the poll. Defaults to :attr:`PollLayoutType.default`.
|
The layout type of the poll. Defaults to :attr:`PollLayoutType.default`.
|
||||||
"""
|
"""
|
||||||
@ -431,7 +431,7 @@ class Poll:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def answers(self) -> List[PollAnswer]:
|
def answers(self) -> List[PollAnswer]:
|
||||||
"""List[:class:`PollAnswer`]: Returns a read-only copy of the answers"""
|
"""List[:class:`PollAnswer`]: Returns a read-only copy of the answers."""
|
||||||
return list(self._answers.values())
|
return list(self._answers.values())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
21
docs/api.rst
21
docs/api.rst
@ -3615,7 +3615,7 @@ of :class:`enum.Enum`.
|
|||||||
|
|
||||||
.. class:: PollLayoutType
|
.. class:: PollLayoutType
|
||||||
|
|
||||||
Represents how a poll answers are shown
|
Represents how a poll answers are shown.
|
||||||
|
|
||||||
.. versionadded:: 2.4
|
.. versionadded:: 2.4
|
||||||
|
|
||||||
@ -5077,6 +5077,14 @@ PartialWebhookChannel
|
|||||||
.. autoclass:: PartialWebhookChannel()
|
.. autoclass:: PartialWebhookChannel()
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
PollAnswer
|
||||||
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
.. attributetable:: PollAnswer
|
||||||
|
|
||||||
|
.. autoclass:: PollAnswer()
|
||||||
|
:members:
|
||||||
|
|
||||||
.. _discord_api_data:
|
.. _discord_api_data:
|
||||||
|
|
||||||
Data Classes
|
Data Classes
|
||||||
@ -5347,18 +5355,15 @@ Poll
|
|||||||
|
|
||||||
.. attributetable:: Poll
|
.. attributetable:: Poll
|
||||||
|
|
||||||
.. autoclass:: Poll()
|
.. autoclass:: Poll
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. attributetable:: PollAnswer
|
PollMedia
|
||||||
|
~~~~~~~~~
|
||||||
.. autoclass:: PollAnswer()
|
|
||||||
:members:
|
|
||||||
:inherited-members:
|
|
||||||
|
|
||||||
.. attributetable:: PollMedia
|
.. attributetable:: PollMedia
|
||||||
|
|
||||||
.. autoclass:: PollMedia()
|
.. autoclass:: PollMedia
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user