@@ -1798,6 +1798,9 @@ async def edit(
17981798 public_updates_channel : TextChannel | None = MISSING ,
17991799 premium_progress_bar_enabled : bool = MISSING ,
18001800 disable_invites : bool = MISSING ,
1801+ discoverable : bool = MISSING ,
1802+ disable_raid_alerts : bool = MISSING ,
1803+ enable_activity_feed : bool = MISSING ,
18011804 ) -> Guild :
18021805 r"""|coro|
18031806
@@ -1875,6 +1878,12 @@ async def edit(
18751878 Whether the guild should have premium progress bar enabled.
18761879 disable_invites: :class:`bool`
18771880 Whether the guild should have server invites enabled or disabled.
1881+ discoverable: :class:`bool`
1882+ Whether the guild should be discoverable in the discover tab.
1883+ disable_raid_alerts: :class:`bool`
1884+ Whether activity alerts for the guild should be disabled.
1885+ enable_activity_feed: class:`bool`
1886+ Whether the guild's user activity feed should be enabled.
18781887 reason: Optional[:class:`str`]
18791888 The reason for editing this guild. Shows up on the audit log.
18801889
@@ -1996,8 +2005,12 @@ async def edit(
19962005
19972006 fields ["system_channel_flags" ] = system_channel_flags .value
19982007
2008+ if premium_progress_bar_enabled is not MISSING :
2009+ fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
2010+
2011+ features : list [GuildFeature ] = self .features .copy ()
2012+
19992013 if community is not MISSING :
2000- features = self .features .copy ()
20012014 if community :
20022015 if (
20032016 "rules_channel_id" in fields
@@ -2007,8 +2020,7 @@ async def edit(
20072020 features .append ("COMMUNITY" )
20082021 else :
20092022 raise InvalidArgument (
2010- "community field requires both rules_channel and"
2011- " public_updates_channel fields to be provided"
2023+ "community field requires both rules_channel and public_updates_channel fields to be provided"
20122024 )
20132025 else :
20142026 if "COMMUNITY" in features :
@@ -2018,20 +2030,43 @@ async def edit(
20182030 fields ["public_updates_channel_id" ] = None
20192031 features .remove ("COMMUNITY" )
20202032
2021- fields ["features" ] = features
2022-
2023- if premium_progress_bar_enabled is not MISSING :
2024- fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
2025-
20262033 if disable_invites is not MISSING :
2027- features = self .features .copy ()
20282034 if disable_invites :
2029- if not "INVITES_DISABLED" in features :
2035+ if "INVITES_DISABLED" not in features :
20302036 features .append ("INVITES_DISABLED" )
20312037 else :
20322038 if "INVITES_DISABLED" in features :
20332039 features .remove ("INVITES_DISABLED" )
20342040
2041+ if discoverable is not MISSING :
2042+ if discoverable :
2043+ if "DISCOVERABLE" not in features :
2044+ features .append ("DISCOVERABLE" )
2045+ else :
2046+ if "DISCOVERABLE" in features :
2047+ features .remove ("DISCOVERABLE" )
2048+
2049+ if disable_raid_alerts is not MISSING :
2050+ if disable_raid_alerts :
2051+ if "RAID_ALERTS_DISABLED" not in features :
2052+ features .append ("RAID_ALERTS_DISABLED" )
2053+ else :
2054+ if "RAID_ALERTS_DISABLED" in features :
2055+ features .remove ("RAID_ALERTS_DISABLED" )
2056+
2057+ if enable_activity_feed is not MISSING :
2058+ if enable_activity_feed :
2059+ if "ACTIVITY_FEED_ENABLED_BY_USER" not in features :
2060+ features .append ("ACTIVITY_FEED_ENABLED_BY_USER" )
2061+ if "ACTIVITY_FEED_DISABLED_BY_USER" in features :
2062+ features .remove ("ACTIVITY_FEED_DISABLED_BY_USER" )
2063+ else :
2064+ if "ACTIVITY_FEED_ENABLED_BY_USER" in features :
2065+ features .remove ("ACTIVITY_FEED_ENABLED_BY_USER" )
2066+ if "ACTIVITY_FEED_DISABLED_BY_USER" not in features :
2067+ features .append ("ACTIVITY_FEED_DISABLED_BY_USER" )
2068+
2069+ if self .features != features :
20352070 fields ["features" ] = features
20362071
20372072 data = await http .edit_guild (self .id , reason = reason , ** fields )
0 commit comments