Skip to content

feat(appinfo): add new approximate_user_authorization_count attribute to AppInfo #1300

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions changelog/1299.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `approximate_user_authorization_count` to :class:`AppInfo`
9 changes: 9 additions & 0 deletions disnake/appinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ class AppInfo:
(for user-installable apps).

.. versionadded:: 2.10

approximate_user_authorization_count: :class:`int`
The approximate number of users that have authorized the app with OAuth2.

.. versionadded:: 2.11
"""

__slots__ = (
Expand Down Expand Up @@ -235,6 +240,7 @@ class AppInfo:
"role_connections_verification_url",
"approximate_guild_count",
"approximate_user_install_count",
"approximate_user_authorization_count",
"_install_types_config",
)

Expand Down Expand Up @@ -279,6 +285,9 @@ def __init__(self, state: ConnectionState, data: AppInfoPayload) -> None:
)
self.approximate_guild_count: int = data.get("approximate_guild_count", 0)
self.approximate_user_install_count: int = data.get("approximate_user_install_count", 0)
self.approximate_user_authorization_count: int = data.get(
"approximate_user_authorization_count", 0
)

# this is a bit of a mess, but there's no better way to expose this data for now
self._install_types_config: Dict[
Expand Down
1 change: 1 addition & 0 deletions disnake/types/appinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class AppInfo(BaseAppInfo):
role_connections_verification_url: NotRequired[str]
approximate_guild_count: NotRequired[int]
approximate_user_install_count: NotRequired[int]
approximate_user_authorization_count: NotRequired[int]
# values in this dict generally shouldn't be null, but they can be empty dicts
integration_types_config: NotRequired[Dict[str, ApplicationIntegrationTypeConfiguration]]

Expand Down
Loading