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

Add approximate_user_install_count to AppInfo #9915

Merged
merged 2 commits into from
Aug 28, 2024
Merged
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
6 changes: 6 additions & 0 deletions discord/appinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class AppInfo:
The approximate count of the guilds the bot was added to.

.. versionadded:: 2.4
approximate_user_install_count: Optional[:class:`int`]
The approximate count of the user-level installations the bot has.

.. versionadded:: 2.5
"""

__slots__ = (
Expand Down Expand Up @@ -175,6 +179,7 @@ class AppInfo:
'interactions_endpoint_url',
'redirect_uris',
'approximate_guild_count',
'approximate_user_install_count',
)

def __init__(self, state: ConnectionState, data: AppInfoPayload):
Expand Down Expand Up @@ -212,6 +217,7 @@ def __init__(self, state: ConnectionState, data: AppInfoPayload):
self.interactions_endpoint_url: Optional[str] = data.get('interactions_endpoint_url')
self.redirect_uris: List[str] = data.get('redirect_uris', [])
self.approximate_guild_count: int = data.get('approximate_guild_count', 0)
self.approximate_user_install_count: Optional[int] = data.get('approximate_user_install_count')

def __repr__(self) -> str:
return (
Expand Down
1 change: 1 addition & 0 deletions discord/types/appinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class BaseAppInfo(TypedDict):
summary: str
description: str
flags: int
approximate_user_install_count: NotRequired[int]
cover_image: NotRequired[str]
terms_of_service_url: NotRequired[str]
privacy_policy_url: NotRequired[str]
Expand Down
Loading