Skip to content

Commit 99d89a0

Browse files
authored
Merge branch 'master' into chore/docs-cleanup
2 parents 8b5c25c + db18056 commit 99d89a0

6 files changed

Lines changed: 30 additions & 15 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ body:
99
Thanks for taking the time to fill out a bug. If you want real-time support,
1010
consider joining our Discord at https://pycord.dev/discord instead.
1111
12+
Please make sure that you tested either the latest (pre-)release [currently https://pypi.org/project/py-cord/2.8.0rc1/] or master, before submitting a bug report.
13+
1214
Please note that this form is for bugs only!
1315
- type: input
1416
attributes:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ These changes are available on the `master` branch, but have not yet been releas
1616

1717
### Fixed
1818

19+
- Fixed a `TypeError` when using `Label.set_select` and not providing `default_values`.
20+
([#3171](https://github.com/Pycord-Development/pycord/pull/3171))
21+
1922
### Deprecated
2023

2124
### Removed

discord/enums.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ class SelectDefaultValueType(Enum):
11391139
class RoleType(IntEnum):
11401140
"""Represents the type of role.
11411141
1142-
This is NOT provided by Discord but is rather computed based on :attr:`Role.tags`.
1142+
This is NOT provided by Discord but is rather computed from :attr:`Role.tags`.
11431143
11441144
.. versionadded:: 2.8
11451145
@@ -1156,7 +1156,8 @@ class RoleType(IntEnum):
11561156
11571157
.. note::
11581158
This is not possible to determine at times because role tags seem to be missing altogether, notably when
1159-
a role is fetched. In such cases :attr:`Role.type` and :attr:`Role.tags` will both be :data:`None`.
1159+
a guild product role is fetched.
1160+
In such cases :attr:`Role.type` will be :attr:`RoleType.NORMAL` and :attr:`Role.tags` will be :data:`None`.
11601161
PREMIUM_SUBSCRIPTION_BASE: :class:`int`
11611162
The role is a base subscription role.
11621163

discord/role.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,41 +213,49 @@ def type(self) -> RoleType:
213213
return RoleType.UNKNOWN
214214

215215
@deprecated(
216-
"RoleTags.is_bot_managed is deprecated since version 2.8, consider using RoleTags.type instead."
216+
"RoleTags.is_bot_managed is deprecated since version 2.8,"
217+
+ " consider using RoleTags.type == RoleType.APPLICATION instead."
217218
)
218219
def is_bot_managed(self) -> bool:
219220
"""Whether the role is associated with a bot.
220221
221222
.. deprecated:: 2.8
222-
Use :attr:`RoleTags.type` instead.
223+
Use ``RoleTags.type == RoleType.APPLICATION`` instead.
223224
"""
224225
return self.bot_id is not None
225226

226227
@deprecated(
227-
"RoleTags.is_premium_subscriber is deprecated since version 2.8, consider using RoleTags.type instead."
228+
"RoleTags.is_premium_subscriber is deprecated since version 2.8,"
229+
+ " consider using RoleTags.type == RoleType.BOOSTER instead."
228230
)
229231
def is_premium_subscriber(self) -> bool:
230232
"""Whether the role is the premium subscriber, AKA "boost", role for the guild.
231233
232234
.. deprecated:: 2.8
233-
Use :attr:`RoleTags.type` instead.
235+
Use ``RoleTags.type == RoleType.BOOSTER`` instead.
234236
"""
235237
return self._premium_subscriber is True
236238

237239
@deprecated(
238-
"RoleTags.is_integration is deprecated since version 2.8, consider using RoleTags.type instead."
240+
"RoleTags.is_integration is deprecated since version 2.8,"
241+
+ " consider using RoleTags.type in"
242+
+ " (RoleType.INTEGRATION, RoleType.PREMIUM_SUBSCRIPTION_TIER,"
243+
+ " RoleType.DRAFT_PREMIUM_SUBSCRIPTION_TIER) instead."
239244
)
240245
def is_integration(self) -> bool:
241246
"""Whether the guild manages the role through some form of
242247
integrations such as Twitch or through guild subscriptions.
243248
244249
.. deprecated:: 2.8
245-
Use :attr:`RoleTags.type` instead.
250+
Use ``RoleTags.type in (RoleType.INTEGRATION,
251+
RoleType.PREMIUM_SUBSCRIPTION_TIER,
252+
RoleType.DRAFT_PREMIUM_SUBSCRIPTION_TIER)`` instead.
246253
"""
247254
return self.integration_id is not None
248255

249256
@deprecated(
250-
"RoleTags.is_available_for_purchase is deprecated since version 2.8, consider using RoleTags.type instead."
257+
"RoleTags.is_available_for_purchase is deprecated since version 2.8,"
258+
+ " consider using RoleTags.type == RoleType.PREMIUM_SUBSCRIPTION_TIER instead."
251259
)
252260
def is_available_for_purchase(self) -> bool:
253261
"""Whether the role is available for purchase.
@@ -257,20 +265,21 @@ def is_available_for_purchase(self) -> bool:
257265
is not linked to a guild subscription.
258266
259267
.. deprecated:: 2.8
260-
Use :attr:`RoleTags.type` instead.
268+
Use ``RoleTags.type == RoleType.PREMIUM_SUBSCRIPTION_TIER`` instead.
261269
262270
.. versionadded:: 2.7
263271
"""
264272
return self._available_for_purchase is True
265273

266274
@deprecated(
267-
"RoleTags.is_guild_connections_role is deprecated since version 2.8, consider using RoleTags.type instead."
275+
"RoleTags.is_guild_connections_role is deprecated since version 2.8,"
276+
+ " consider using RoleTags.type == RoleType.CONNECTION instead."
268277
)
269278
def is_guild_connections_role(self) -> bool:
270279
"""Whether the role is a guild connections role.
271280
272281
.. deprecated:: 2.8
273-
Use :attr:`RoleTags.type` instead.
282+
Use ``RoleTags.type == RoleType.CONNECTION`` instead.
274283
275284
.. versionadded:: 2.7
276285
"""

discord/ui/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def set_select(
311311
channel_types: list[ChannelType] | None = None,
312312
required: bool = True,
313313
id: int | None = None,
314-
default_values: Sequence[SelectDefaultValue] | None = ...,
314+
default_values: Sequence[SelectDefaultValue] | None = None,
315315
) -> Self:
316316
"""Set this label's item to a select menu.
317317

docs/api/enums.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ of :class:`enum.Enum`.
2929
A string.
3030
.. attribute:: integer
3131

32-
An integer between -2⁵³ and 2⁵³.
32+
An integer where :math:`-2^{53} < x < 2^{53}`.
3333

3434
.. note::
3535

@@ -52,7 +52,7 @@ of :class:`enum.Enum`.
5252
A mentionable (user or role).
5353
.. attribute:: number
5454

55-
A floating-point number between -2⁵³ and 2⁵³.
55+
A floating-point number where :math:`-2^{53} < x < 2^{53}`.
5656

5757
.. note::
5858

0 commit comments

Comments
 (0)