@@ -1703,6 +1703,9 @@ async def edit(
17031703 public_updates_channel : TextChannel | None = MISSING ,
17041704 premium_progress_bar_enabled : bool = MISSING ,
17051705 disable_invites : bool = MISSING ,
1706+ discoverable : bool = MISSING ,
1707+ disable_raid_alerts : bool = MISSING ,
1708+ enable_activity_feed : bool = MISSING ,
17061709 ) -> Guild :
17071710 r"""|coro|
17081711
@@ -1780,6 +1783,12 @@ async def edit(
17801783 Whether the guild should have premium progress bar enabled.
17811784 disable_invites: :class:`bool`
17821785 Whether the guild should have server invites enabled or disabled.
1786+ discoverable: :class:`bool`
1787+ Whether the guild should be discoverable in the discover tab.
1788+ disable_raid_alerts: :class:`bool`
1789+ Whether activity alerts for the guild should be disabled.
1790+ enable_activity_feed: class:`bool`
1791+ Whether the guild's user activity feed should be enabled.
17831792 reason: Optional[:class:`str`]
17841793 The reason for editing this guild. Shows up on the audit log.
17851794
@@ -1901,8 +1910,12 @@ async def edit(
19011910
19021911 fields ["system_channel_flags" ] = system_channel_flags .value
19031912
1913+ if premium_progress_bar_enabled is not MISSING :
1914+ fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1915+
1916+ features : list [GuildFeature ] = self .features .copy ()
1917+
19041918 if community is not MISSING :
1905- features = self .features .copy ()
19061919 if community :
19071920 if (
19081921 "rules_channel_id" in fields
@@ -1912,8 +1925,7 @@ async def edit(
19121925 features .append ("COMMUNITY" )
19131926 else :
19141927 raise InvalidArgument (
1915- "community field requires both rules_channel and"
1916- " public_updates_channel fields to be provided"
1928+ "community field requires both rules_channel and public_updates_channel fields to be provided"
19171929 )
19181930 else :
19191931 if "COMMUNITY" in features :
@@ -1923,20 +1935,43 @@ async def edit(
19231935 fields ["public_updates_channel_id" ] = None
19241936 features .remove ("COMMUNITY" )
19251937
1926- fields ["features" ] = features
1927-
1928- if premium_progress_bar_enabled is not MISSING :
1929- fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1930-
19311938 if disable_invites is not MISSING :
1932- features = self .features .copy ()
19331939 if disable_invites :
1934- if not "INVITES_DISABLED" in features :
1940+ if "INVITES_DISABLED" not in features :
19351941 features .append ("INVITES_DISABLED" )
19361942 else :
19371943 if "INVITES_DISABLED" in features :
19381944 features .remove ("INVITES_DISABLED" )
19391945
1946+ if discoverable is not MISSING :
1947+ if discoverable :
1948+ if "DISCOVERABLE" not in features :
1949+ features .append ("DISCOVERABLE" )
1950+ else :
1951+ if "DISCOVERABLE" in features :
1952+ features .remove ("DISCOVERABLE" )
1953+
1954+ if disable_raid_alerts is not MISSING :
1955+ if disable_raid_alerts :
1956+ if "RAID_ALERTS_DISABLED" not in features :
1957+ features .append ("RAID_ALERTS_DISABLED" )
1958+ else :
1959+ if "RAID_ALERTS_DISABLED" in features :
1960+ features .remove ("RAID_ALERTS_DISABLED" )
1961+
1962+ if enable_activity_feed is not MISSING :
1963+ if enable_activity_feed :
1964+ if "ACTIVITY_FEED_ENABLED_BY_USER" not in features :
1965+ features .append ("ACTIVITY_FEED_ENABLED_BY_USER" )
1966+ if "ACTIVITY_FEED_DISABLED_BY_USER" in features :
1967+ features .remove ("ACTIVITY_FEED_DISABLED_BY_USER" )
1968+ else :
1969+ if "ACTIVITY_FEED_ENABLED_BY_USER" in features :
1970+ features .remove ("ACTIVITY_FEED_ENABLED_BY_USER" )
1971+ if "ACTIVITY_FEED_DISABLED_BY_USER" not in features :
1972+ features .append ("ACTIVITY_FEED_DISABLED_BY_USER" )
1973+
1974+ if self .features != features :
19401975 fields ["features" ] = features
19411976
19421977 data = await http .edit_guild (self .id , reason = reason , ** fields )
0 commit comments