From cf5cac5715df2d2458489fcf28edeef207e73187 Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:30:26 +0100 Subject: [PATCH 1/7] fix: typing in ScheduledEvent.subscribers --- discord/iterators.py | 2 +- discord/scheduled_events.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/iterators.py b/discord/iterators.py index de442aa0fb..d8fad2aad5 100644 --- a/discord/iterators.py +++ b/discord/iterators.py @@ -852,7 +852,7 @@ 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, diff --git a/discord/scheduled_events.py b/discord/scheduled_events.py index cda13f48b9..24741b7369 100644 --- a/discord/scheduled_events.py +++ b/discord/scheduled_events.py @@ -482,7 +482,7 @@ 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, From e175b2e4d2690594605f8fdb78d5d307769103a1 Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:37:41 +0100 Subject: [PATCH 2/7] update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3f5595f10..0a8c834ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) +- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual + behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2400)) - Fixed a deprecation warning from being displayed when running `python -m discord -v` by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) From 87263ef2ac66c2f924749b3c94cfa1ff4bdc2553 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:38:05 +0000 Subject: [PATCH 3/7] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8c834ff3..5df84d26d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) -- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual - behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2400)) +- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior. + ([#2386](https://github.com/Pycord-Development/pycord/pull/2400)) - Fixed a deprecation warning from being displayed when running `python -m discord -v` by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) From c394a14e98d18592b7714a62dcc1c10823567307 Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:48:27 +0100 Subject: [PATCH 4/7] fix: return type of `subscribers` --- discord/scheduled_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/scheduled_events.py b/discord/scheduled_events.py index 24741b7369..4ba16bcdec 100644 --- a/discord/scheduled_events.py +++ b/discord/scheduled_events.py @@ -486,7 +486,7 @@ def subscribers( 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 From f20444068fb138f8f3a3460f0a6b2ed70fd04acb Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Wed, 20 Mar 2024 00:17:03 +0100 Subject: [PATCH 5/7] Update CHANGELOG.md Signed-off-by: YoggieS <61660055+yoggys@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df84d26d6..14805c965f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) - Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior. - ([#2386](https://github.com/Pycord-Development/pycord/pull/2400)) + ([#2400](https://github.com/Pycord-Development/pycord/pull/2400)) - Fixed a deprecation warning from being displayed when running `python -m discord -v` by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) From bdf2e8a4d65dde3662250688cceabf4626da9a0f Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Wed, 20 Mar 2024 23:25:03 +0100 Subject: [PATCH 6/7] fix: before/after parameter optional --- discord/iterators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/iterators.py b/discord/iterators.py index d8fad2aad5..ef7ef9be85 100644 --- a/discord/iterators.py +++ b/discord/iterators.py @@ -854,8 +854,8 @@ def __init__( event: ScheduledEvent, 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)) From 4beaa1c9f87f2858b739168f69387a8fbb49ec24 Mon Sep 17 00:00:00 2001 From: YoggieS <61660055+yoggys@users.noreply.github.com> Date: Thu, 21 Mar 2024 20:46:38 +0100 Subject: [PATCH 7/7] Update CHANGELOG.md Signed-off-by: YoggieS <61660055+yoggys@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14805c965f..f1356bc6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,13 +21,13 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) -- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior. - ([#2400](https://github.com/Pycord-Development/pycord/pull/2400)) - Fixed a deprecation warning from being displayed when running `python -m discord -v` by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) - Fixed `Paginator.edit` to no longer set user to the bot. ([#2390](https://github.com/Pycord-Development/pycord/pull/2390)) +- Fixed the type-hinting of `ScheduledEvent.subscribers` to reflect actual behavior. + ([#2400](https://github.com/Pycord-Development/pycord/pull/2400)) ### Changed