Skip to content

Commit

Permalink
fix: type-hinting in ScheduledEvent.subscribers (Pycord-Development#2400
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yoggys authored Mar 22, 2024
1 parent 532db98 commit a29bc14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2390](https://github.com/Pycord-Development/pycord/pull/2390))
- Fixed `NameError` in some instances of `Interaction`.
([#2402](https://github.com/Pycord-Development/pycord/pull/2402))
- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior.
([#2400](https://github.com/Pycord-Development/pycord/pull/2400))

### Changed

Expand Down
6 changes: 3 additions & 3 deletions discord/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,10 @@ class ScheduledEventSubscribersIterator(_AsyncIterator[Union["User", "Member"]])
def __init__(
self,
event: ScheduledEvent,
limit: int,
limit: int | None,
with_member: bool = False,
before: datetime.datetime | int = None,
after: datetime.datetime | int = None,
before: datetime.datetime | int | None = None,
after: datetime.datetime | int | None = None,
):
if isinstance(before, datetime.datetime):
before = Object(id=time_snowflake(before, high=False))
Expand Down
4 changes: 2 additions & 2 deletions discord/scheduled_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ async def cancel(self, *, reason: str | None = None) -> None:
def subscribers(
self,
*,
limit: int = 100,
limit: int | None = 100,
as_member: bool = False,
before: Snowflake | datetime.datetime | None = None,
after: Snowflake | datetime.datetime | None = None,
) -> AsyncIterator:
) -> ScheduledEventSubscribersIterator:
"""Returns an :class:`AsyncIterator` representing the users or members subscribed to the event.
The ``after`` and ``before`` parameters must represent member
Expand Down

0 comments on commit a29bc14

Please sign in to comment.