Skip to content
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

fix: type-hinting in ScheduledEvent.subscribers #2400

Merged
merged 13 commits into from Mar 22, 2024
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
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
Expand Up @@ -852,10 +852,10 @@ class ScheduledEventSubscribersIterator(_AsyncIterator[Union["User", "Member"]])
def __init__(
self,
event: ScheduledEvent,
limit: int,
limit: int | None,
yoggys marked this conversation as resolved.
Show resolved Hide resolved
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
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