This affects Messageable.history, ScheduledEvent.users,
Client.fetch_guilds, and Guild.audit_logs.
To illustrate the problem, Messageable.history counted returned
messages to tell when to stop iteration, but did so before filtering
away those past the before or after boundaries. When both
oldest_first=False and an after boundary were provided, this led to the
history iterator continuing to retrieve messages older than the after
boundary, which would then all be filtered away, continuing until the
message limit or the beginning of the entire channel was reached.
A similar situation would also occur with oldest_first=True and a
before boundary provided.
This commit changes the logic in these methods to count items after
filtering, so they stop requesting more as soon as the in-bounds items
are exhausted.
* Initial implementation
* Expose various rich methods to fetch the new models
* Add localize parameters and remove useless payment_source parameters from front-facing fetch methods
* Implement fetching and (partially) redeeming gifts
* Slot remaining models
* Correctly document Gift.redeem() channel parameter
* Implement some stuffs, fix more stuffs, add creating/editing skus/store listings
* Various context properties fixes
* Fix various types, expose SubscriptionPlan
* (Partially) implement purchasing SKUs and gift flags
* Finish and clean-up store/applications API implementations
* Implement build uls, missing sub plan params, purchase sku ret
* Fix upload_files() warning
* Formatter pass
* Normalize include_x to with_x, add various small missing things
* Update sub on manual invoice payment instead of returning new object
* Black pass
* Implement missing integrations/applications API shit
* Implement Application.store_listing_sku_id
* Expose richer subscription metadata guild info
* Implement SKU.system_requirements localization and modification
* Black pass
* Implement premium usage
* Implement application whitelist
* Implement active developer program enrollment
* Readd new team members to cache
* Polishing
* Implement leaving active developer program
* Type everything
* Expose everything
* Implement relationship activity statistics, improve model
* Black pass
* Document everything
* Add crunchyroll connection type (#426)
* Fix type-checking error in PrivateChannel ABC (#427)
* Update required property fetching to new domain
* Pin black to v22.6
* Get pyright to shut up
* Black pass
* Get pyright to shut up