diff --git a/interactions/client/const.py b/interactions/client/const.py index 52eb709f8..47c99d69d 100644 --- a/interactions/client/const.py +++ b/interactions/client/const.py @@ -135,7 +135,7 @@ def get_logger() -> logging.Logger: EMBED_FIELD_VALUE_LENGTH = 1024 POLL_MAX_ANSWERS = 10 -POLL_MAX_DURATION_HOURS = 168 +POLL_MAX_DURATION_HOURS = 768 class Singleton(type): @@ -244,7 +244,7 @@ def has_client_feature(feature: str) -> bool: if TYPE_CHECKING: from interactions import Client - ClientT = typing_extensions.TypeVar("ClientT", bound=Client, default=Client) + ClientT = typing_extensions.TypeVar("ClientT", bound=Client, default=Client, covariant=True) else: ClientT = TypeVar("ClientT") diff --git a/interactions/models/discord/enums.py b/interactions/models/discord/enums.py index 07da3d4bd..550711749 100644 --- a/interactions/models/discord/enums.py +++ b/interactions/models/discord/enums.py @@ -205,12 +205,15 @@ class Intents(DiscordIntFlag): # type: ignore GUILD_SCHEDULED_EVENTS = 1 << 16 AUTO_MODERATION_CONFIGURATION = 1 << 20 AUTO_MODERATION_EXECUTION = 1 << 21 + GUILD_MESSAGE_POLLS = 1 << 24 + DIRECT_MESSAGE_POLLS = 1 << 25 # Shortcuts/grouping/aliases MESSAGES = GUILD_MESSAGES | DIRECT_MESSAGES REACTIONS = GUILD_MESSAGE_REACTIONS | DIRECT_MESSAGE_REACTIONS TYPING = GUILD_MESSAGE_TYPING | DIRECT_MESSAGE_TYPING AUTO_MOD = AUTO_MODERATION_CONFIGURATION | AUTO_MODERATION_EXECUTION + POLLS = GUILD_MESSAGE_POLLS | DIRECT_MESSAGE_POLLS PRIVILEGED = GUILD_PRESENCES | GUILD_MEMBERS | MESSAGE_CONTENT NON_PRIVILEGED = AntiFlag(PRIVILEGED) @@ -233,14 +236,17 @@ def new( guild_voice_states=False, guild_presences=False, guild_messages=False, + guild_message_polls=False, guild_message_reactions=False, guild_message_typing=False, direct_messages=False, + direct_message_polls=False, direct_message_reactions=False, direct_message_typing=False, message_content=False, guild_scheduled_events=False, messages=False, + polls=False, reactions=False, typing=False, privileged=False, diff --git a/interactions/models/discord/poll.py b/interactions/models/discord/poll.py index 1656d7e23..7498e0c14 100644 --- a/interactions/models/discord/poll.py +++ b/interactions/models/discord/poll.py @@ -9,7 +9,6 @@ timestamp_converter, ) from interactions.client.mixins.serialization import DictSerializationMixin -from interactions.client.utils.serializer import no_export_meta from interactions.models.discord.emoji import PartialEmoji, process_emoji from interactions.models.discord.enums import PollLayoutType from interactions.models.discord.timestamp import Timestamp @@ -92,8 +91,8 @@ class Poll(DictSerializationMixin): answers: list[PollAnswer] = attrs.field(repr=False, factory=list, converter=PollAnswer.from_list) """Each of the answers available in the poll, up to 10.""" expiry: Timestamp = attrs.field(repr=False, default=MISSING, converter=optional(timestamp_converter)) - """Number of hours the poll is open for, up to 7 days.""" - allow_multiselect: bool = attrs.field(repr=False, default=False, metadata=no_export_meta) + """Number of hours the poll is open for, up to 32 days.""" + allow_multiselect: bool = attrs.field(repr=False, default=False) """Whether a user can select multiple answers.""" layout_type: PollLayoutType = attrs.field(repr=False, default=PollLayoutType.DEFAULT, converter=PollLayoutType) """The layout type of the poll.""" @@ -101,7 +100,7 @@ class Poll(DictSerializationMixin): """The results of the poll, if the polls is finished.""" _duration: int = attrs.field(repr=False, default=0) - """How long, in hours, the poll will be open for (up to 7 days). This is only used when creating polls.""" + """How long, in hours, the poll will be open for (up to 32 days). This is only used when creating polls.""" @classmethod def create( diff --git a/pyproject.toml b/pyproject.toml index d4e2d8501..b93cbf7ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "interactions.py" -version = "5.13.0" +version = "5.13.1" description = "Easy, simple, scalable and modular: a Python API wrapper for interactions." authors = ["LordOfPolls "]