Skip to content

Commit a29bc14

Browse files
authored
fix: type-hinting in ScheduledEvent.subscribers (Pycord-Development#2400)
1 parent 532db98 commit a29bc14

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ These changes are available on the `master` branch, but have not yet been releas
2828
([#2390](https://github.com/Pycord-Development/pycord/pull/2390))
2929
- Fixed `NameError` in some instances of `Interaction`.
3030
([#2402](https://github.com/Pycord-Development/pycord/pull/2402))
31+
- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior.
32+
([#2400](https://github.com/Pycord-Development/pycord/pull/2400))
3133

3234
### Changed
3335

discord/iterators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,10 @@ class ScheduledEventSubscribersIterator(_AsyncIterator[Union["User", "Member"]])
852852
def __init__(
853853
self,
854854
event: ScheduledEvent,
855-
limit: int,
855+
limit: int | None,
856856
with_member: bool = False,
857-
before: datetime.datetime | int = None,
858-
after: datetime.datetime | int = None,
857+
before: datetime.datetime | int | None = None,
858+
after: datetime.datetime | int | None = None,
859859
):
860860
if isinstance(before, datetime.datetime):
861861
before = Object(id=time_snowflake(before, high=False))

discord/scheduled_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ async def cancel(self, *, reason: str | None = None) -> None:
482482
def subscribers(
483483
self,
484484
*,
485-
limit: int = 100,
485+
limit: int | None = 100,
486486
as_member: bool = False,
487487
before: Snowflake | datetime.datetime | None = None,
488488
after: Snowflake | datetime.datetime | None = None,
489-
) -> AsyncIterator:
489+
) -> ScheduledEventSubscribersIterator:
490490
"""Returns an :class:`AsyncIterator` representing the users or members subscribed to the event.
491491
492492
The ``after`` and ``before`` parameters must represent member

0 commit comments

Comments
 (0)