Skip to content

fix(sku)!: change SKU.subscriptions to be a sync method #1274

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions changelog/1274.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:meth:`SKU.subscriptions` mistakenly returned a coroutine, unlike other iterator methods. Instead of ``async for x in await sku.subscriptions():``, correct usage now is ``async for x in sku.subscriptions():``.
1 change: 1 addition & 0 deletions changelog/1274.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change :meth:`SKU.subscriptions` to be a synchronous method (returning an async iterator), to match other iterator methods.
6 changes: 2 additions & 4 deletions disnake/sku.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,15 @@ def flags(self) -> SKUFlags:
""":class:`SKUFlags`: Returns the SKU's flags."""
return SKUFlags._from_value(self._flags)

async def subscriptions(
def subscriptions(
self,
user: Snowflake,
*,
limit: Optional[int] = 50,
before: Optional[SnowflakeTime] = None,
after: Optional[SnowflakeTime] = None,
) -> SubscriptionIterator:
"""|coro|

Retrieves an :class:`.AsyncIterator` that enables receiving subscriptions for the SKU.
"""Retrieves an :class:`.AsyncIterator` that enables receiving subscriptions for the SKU.

All parameters, except ``user``, are optional.

Expand Down
Loading