Skip to content

Commit

Permalink
refactor: SKU.subscriptions#user should take a snowflake, not int
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Dec 29, 2024
1 parent 6a7a905 commit 7f5ea52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion disnake/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ def __init__(
self,
sku_id: int,
*,
user_id: Optional[int] = None,
state: ConnectionState,
user_id: Optional[int] = None, # required, except for oauth queries
limit: Optional[int] = None,
before: Optional[Union[Snowflake, datetime.datetime]] = None,
after: Optional[Union[Snowflake, datetime.datetime]] = None,
Expand Down
12 changes: 6 additions & 6 deletions disnake/sku.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .utils import snowflake_time

if TYPE_CHECKING:
from .abc import SnowflakeTime
from .abc import Snowflake, SnowflakeTime
from .state import ConnectionState
from .types.sku import SKU as SKUPayload

Expand Down Expand Up @@ -89,21 +89,21 @@ def flags(self) -> SKUFlags:

async def subscriptions(
self,
user_id: int,
user: Snowflake,
*,
limit: Optional[int] = 50,
before: Optional[SnowflakeTime] = None,
after: Optional[SnowflakeTime] = None,
) -> SubscriptionIterator:
"""|coro|
Retrieves an :class:`.AsyncIterator` that enabled receiving subscriptions for the SKU.
Retrieves an :class:`.AsyncIterator` that enables receiving subscriptions for the SKU.
All parameters are optional.
All parameters, except ``user``, are optional.
Parameters
----------
user: :class:`int`
user: :class:`abc.Snowflake`
The user to retrieve subscriptions for.
limit: Optional[:class:`int`]
The number of subscriptions to retrieve.
Expand Down Expand Up @@ -132,10 +132,10 @@ async def subscriptions(
return SubscriptionIterator(
self.id,
state=self._state,
user_id=user.id,
limit=limit,
before=before,
after=after,
user_id=user_id,
)

async def fetch_subscription(self, subscription_id: int, /) -> Subscription:
Expand Down

0 comments on commit 7f5ea52

Please sign in to comment.