8000 feat: Add guild_id parameter to Client.entitlements() by lukenamop · Pull Request #2597 · Pycord-Development/pycord · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add guild_id parameter to Client.entitlements() #2597

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2556](https://github.com/Pycord-Development/pycord/pull/2556))
- Added optional `filter` parameter to `utils.basic_autocomplete()`.
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
- Added optional `guild_id` parameter to `Client.entitlements()`.
([#2597](https://github.com/Pycord-Development/pycord/pull/2597))

### Fixed

Expand Down
6 changes: 5 additions & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,7 @@ def entitlements(
after: SnowflakeTime | None = None,
limit: int | None = 100,
guild: Snowflake | None = None,
guild_id: int | None = None,
exclude_ended: bool = False,
) -> EntitlementIterator:
"""Returns an :class:`.AsyncIterator` that enables fetching the application's entitlements.
Expand All @@ -2084,6 +2085,9 @@ def entitlements(
Defaults to ``100``.
guild: :class:`.abc.Snowflake` | None
Limit the fetched entitlements to entitlements owned by this guild.
If not ``None``, ``guild`` takes priority over ``guild_id``.
guild_id: :class:`int` | None
Limit the fetched entitlements to entitlements owned by a guild with this ID.
exclude_ended: :class:`bool`
Whether to limit the fetched entitlements to those that have not ended.
Defaults to ``False``.
Expand Down Expand Up @@ -2119,7 +2123,7 @@ def entitlements(
before=before,
after=after,
limit=limit,
guild_id=guild.id if guild else None,
guild_id=guild.id if guild else guild_id if guild_id else None,
exclude_ended=exclude_ended,
)

Expand Down
0