Skip to content

5.13.1 #1710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2024
Merged

5.13.1 #1710

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions interactions/client/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")

Expand Down
6 changes: 6 additions & 0 deletions interactions/models/discord/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions interactions/models/discord/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -92,16 +91,16 @@ 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."""
results: Optional[PollResults] = attrs.field(repr=False, default=None, converter=optional(PollResults.from_dict))
"""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(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <dev@lordofpolls.com>"]

Expand Down
Loading