Skip to content
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

fix: premium buttons and entitlement iterator #2490

Merged
merged 11 commits into from
Jul 3, 2024
8 changes: 4 additions & 4 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,7 +2085,7 @@ async def fetch_entitlements(

Returns
-------
List[:class:`.Entitlement`]
:class:`.EntitlementIterator`
The application's entitlements.

Raises
Expand All @@ -2095,12 +2095,12 @@ async def fetch_entitlements(
"""
return EntitlementIterator(
self._connection,
user_id=user.id,
sku_ids=[sku.id for sku in skus],
user_id=user.id if user else None,
sku_ids=[sku.id for sku in skus] if skus else None,
before=before,
after=after,
limit=limit,
guild_id=guild.id,
guild_id=guild.id if guild else None,
exclude_ended=exclude_ended,
)

Expand Down
2 changes: 1 addition & 1 deletion discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,7 @@ def list_entitlements(
if guild_id is not None:
params["guild_id"] = guild_id
if exclude_ended is not None:
params["exclude_ended"] = exclude_ended
params["exclude_ended"] = int(exclude_ended)

r = Route(
"GET",
Expand Down
2 changes: 1 addition & 1 deletion discord/ui/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(
)

self._provided_custom_id = custom_id is not None
if url is None and custom_id is None:
if url is None and custom_id is None and sku_id is None:
custom_id = os.urandom(16).hex()

if url is not None:
Expand Down
Loading