From 5681957da8b1428cfa64e532d81c0cf382c3884f Mon Sep 17 00:00:00 2001 From: dolfies Date: Tue, 29 Aug 2023 23:19:50 +0300 Subject: [PATCH] Rename Guild.owner_application_id and document in audit log --- discord/guild.py | 12 +++++++++--- docs/api.rst | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index de16159c8..a01205e86 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -351,8 +351,14 @@ class Guild(Hashable): The guild's ID. owner_id: :class:`int` The guild owner's ID. - owner_application_id: Optional[:class:`int`] + application_id: Optional[:class:`int`] The application ID of the guild owner (if applicable). + + .. versionadded:: 2.0 + + .. versionchanged:: 2.1 + + Renamed from ``owner_application_id`` to ``application_id``. unavailable: :class:`bool` Indicates if the guild is unavailable. If this is ``True`` then the reliability of other attributes outside of :attr:`Guild.id` is slim and they might @@ -450,7 +456,7 @@ class Guild(Hashable): 'nsfw_level', 'mfa_level', 'vanity_url_code', - 'owner_application_id', + 'application_id', 'widget_enabled', '_widget_channel_id', '_members', @@ -687,7 +693,7 @@ class Guild(Hashable): self.approximate_presence_count: Optional[int] = guild.get('approximate_presence_count') self.approximate_member_count: Optional[int] = guild.get('approximate_member_count') self.owner_id: Optional[int] = utils._get_as_snowflake(guild, 'owner_id') - self.owner_application_id: Optional[int] = utils._get_as_snowflake(guild, 'application_id') + self.application_id: Optional[int] = utils._get_as_snowflake(guild, 'application_id') self.premium_progress_bar_enabled: bool = guild.get('premium_progress_bar_enabled', False) self._joined_at = guild.get('joined_at') diff --git a/docs/api.rst b/docs/api.rst index e55cbf023..9a8b86fd7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5931,6 +5931,12 @@ AuditLogDiff :type: Union[:class:`Member`, :class:`User`] + .. attribute:: application_id + + The application ID of the guild owner (if applicable). See also :attr:`Guild.application_id`. + + :type: :class:`int` + .. attribute:: afk_channel The guild's AFK channel. @@ -6501,7 +6507,7 @@ AuditLogDiff :type: :class:`default_reaction_emoji` -.. this is currently missing the following keys: reason and application_id +.. this is currently missing the following keys: reason I'm not sure how to port these Webhook Support