Skip to content

Commit 30eaf2d

Browse files
committed
Merge branch 'unstable' into fix-multiselect
Signed-off-by: Katelyn Gigante <[email protected]>
2 parents 6877750 + 1dac6e0 commit 30eaf2d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

interactions/client/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def get_logger() -> logging.Logger:
135135
EMBED_FIELD_VALUE_LENGTH = 1024
136136

137137
POLL_MAX_ANSWERS = 10
138-
POLL_MAX_DURATION_HOURS = 168
138+
POLL_MAX_DURATION_HOURS = 768
139139

140140

141141
class Singleton(type):
@@ -244,7 +244,7 @@ def has_client_feature(feature: str) -> bool:
244244
if TYPE_CHECKING:
245245
from interactions import Client
246246

247-
ClientT = typing_extensions.TypeVar("ClientT", bound=Client, default=Client)
247+
ClientT = typing_extensions.TypeVar("ClientT", bound=Client, default=Client, covariant=True)
248248
else:
249249
ClientT = TypeVar("ClientT")
250250

interactions/models/discord/enums.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,15 @@ class Intents(DiscordIntFlag): # type: ignore
205205
GUILD_SCHEDULED_EVENTS = 1 << 16
206206
AUTO_MODERATION_CONFIGURATION = 1 << 20
207207
AUTO_MODERATION_EXECUTION = 1 << 21
208+
GUILD_MESSAGE_POLLS = 1 << 24
209+
DIRECT_MESSAGE_POLLS = 1 << 25
208210

209211
# Shortcuts/grouping/aliases
210212
MESSAGES = GUILD_MESSAGES | DIRECT_MESSAGES
211213
REACTIONS = GUILD_MESSAGE_REACTIONS | DIRECT_MESSAGE_REACTIONS
212214
TYPING = GUILD_MESSAGE_TYPING | DIRECT_MESSAGE_TYPING
213215
AUTO_MOD = AUTO_MODERATION_CONFIGURATION | AUTO_MODERATION_EXECUTION
216+
POLLS = GUILD_MESSAGE_POLLS | DIRECT_MESSAGE_POLLS
214217

215218
PRIVILEGED = GUILD_PRESENCES | GUILD_MEMBERS | MESSAGE_CONTENT
216219
NON_PRIVILEGED = AntiFlag(PRIVILEGED)
@@ -233,14 +236,17 @@ def new(
233236
guild_voice_states=False,
234237
guild_presences=False,
235238
guild_messages=False,
239+
guild_message_polls=False,
236240
guild_message_reactions=False,
237241
guild_message_typing=False,
238242
direct_messages=False,
243+
direct_message_polls=False,
239244
direct_message_reactions=False,
240245
direct_message_typing=False,
241246
message_content=False,
242247
guild_scheduled_events=False,
243248
messages=False,
249+
polls=False,
244250
reactions=False,
245251
typing=False,
246252
privileged=False,

interactions/models/discord/poll.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Poll(DictSerializationMixin):
9191
answers: list[PollAnswer] = attrs.field(repr=False, factory=list, converter=PollAnswer.from_list)
9292
"""Each of the answers available in the poll, up to 10."""
9393
expiry: Timestamp = attrs.field(repr=False, default=MISSING, converter=optional(timestamp_converter))
94-
"""Number of hours the poll is open for, up to 7 days."""
94+
"""Number of hours the poll is open for, up to 32 days."""
9595
allow_multiselect: bool = attrs.field(repr=False, default=False)
9696
"""Whether a user can select multiple answers."""
9797
layout_type: PollLayoutType = attrs.field(repr=False, default=PollLayoutType.DEFAULT, converter=PollLayoutType)
@@ -100,7 +100,7 @@ class Poll(DictSerializationMixin):
100100
"""The results of the poll, if the polls is finished."""
101101

102102
_duration: int = attrs.field(repr=False, default=0)
103-
"""How long, in hours, the poll will be open for (up to 7 days). This is only used when creating polls."""
103+
"""How long, in hours, the poll will be open for (up to 32 days). This is only used when creating polls."""
104104

105105
@classmethod
106106
def create(

0 commit comments

Comments
 (0)