diff --git a/changelog/1274.breaking.rst b/changelog/1274.breaking.rst new file mode 100644 index 0000000000..ce9f6830cd --- /dev/null +++ b/changelog/1274.breaking.rst @@ -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():``. diff --git a/changelog/1274.bugfix.rst b/changelog/1274.bugfix.rst new file mode 100644 index 0000000000..4a2d397404 --- /dev/null +++ b/changelog/1274.bugfix.rst @@ -0,0 +1 @@ +Change :meth:`SKU.subscriptions` to be a synchronous method (returning an async iterator), to match other iterator methods. diff --git a/disnake/sku.py b/disnake/sku.py index 3b9e4fabb3..418879fd68 100644 --- a/disnake/sku.py +++ b/disnake/sku.py @@ -87,7 +87,7 @@ 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, *, @@ -95,9 +95,7 @@ async def subscriptions( 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.