Add support for Polls

Co-authored-by: owocado <24418520+owocado@users.noreply.github.com>
Co-authored-by: Josh <8677174+bijij@users.noreply.github.com>
Co-authored-by: Trevor Flahardy <75498301+trevorflahardy@users.noreply.github.com>
This commit is contained in:
DA344
2024-05-10 12:14:12 +02:00
committed by GitHub
parent a1206dfde8
commit e43bd8692c
19 changed files with 1097 additions and 1 deletions

View File

@ -1257,6 +1257,57 @@ class Intents(BaseFlags):
"""
return 1 << 21
@alias_flag_value
def polls(self):
""":class:`bool`: Whether guild and direct messages poll related events are enabled.
This is a shortcut to set or get both :attr:`guild_polls` and :attr:`dm_polls`.
This corresponds to the following events:
- :func:`on_poll_vote_add` (both guilds and DMs)
- :func:`on_poll_vote_remove` (both guilds and DMs)
- :func:`on_raw_poll_vote_add` (both guilds and DMs)
- :func:`on_raw_poll_vote_remove` (both guilds and DMs)
.. versionadded:: 2.4
"""
return (1 << 24) | (1 << 25)
@flag_value
def guild_polls(self):
""":class:`bool`: Whether guild poll related events are enabled.
See also :attr:`dm_polls` and :attr:`polls`.
This corresponds to the following events:
- :func:`on_poll_vote_add` (only for guilds)
- :func:`on_poll_vote_remove` (only for guilds)
- :func:`on_raw_poll_vote_add` (only for guilds)
- :func:`on_raw_poll_vote_remove` (only for guilds)
.. versionadded:: 2.4
"""
return 1 << 24
@flag_value
def dm_polls(self):
""":class:`bool`: Whether direct messages poll related events are enabled.
See also :attr:`guild_polls` and :attr:`polls`.
This corresponds to the following events:
- :func:`on_poll_vote_add` (only for DMs)
- :func:`on_poll_vote_remove` (only for DMs)
- :func:`on_raw_poll_vote_add` (only for DMs)
- :func:`on_raw_poll_vote_remove` (only for DMs)
.. versionadded:: 2.4
"""
return 1 << 25
@fill_with_flags()
class MemberCacheFlags(BaseFlags):