From dfff20d5a9cbbe52a4c55d735138593234ef83db Mon Sep 17 00:00:00 2001 From: xCirno <78838310+xCirno1@users.noreply.github.com> Date: Wed, 11 May 2022 09:59:22 +0700 Subject: [PATCH] Add widget_enabled attribute to Guild --- discord/guild.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/discord/guild.py b/discord/guild.py index 98c2e131d..15bed1634 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -269,6 +269,10 @@ class Guild(Hashable): .. versionadded:: 2.0 primary_category_id: Optional[:class:`int`] The ID of the primary discovery category for the guild. + widget_enabled: :class:`bool` + Indicates if the guild has widget enabled. + + .. versionadded:: 2.0 """ __slots__ = ( @@ -295,6 +299,7 @@ class Guild(Hashable): 'vanity_url_code', 'owner_application_id', 'command_counts', + 'widget_enabled', '_members', '_channels', '_icon', @@ -511,6 +516,7 @@ class Guild(Hashable): self.premium_tier: int = guild.get('premium_tier', 0) self.premium_subscription_count: int = guild.get('premium_subscription_count') or 0 self.vanity_url_code: Optional[str] = guild.get('vanity_url_code') + self.widget_enabled: bool = guild.get('widget_enabled', False) self._system_channel_flags: int = guild.get('system_channel_flags', 0) self.preferred_locale: Locale = try_enum(Locale, guild.get('preferred_locale', 'en-US')) self._discovery_splash: Optional[str] = guild.get('discovery_splash')