@@ -1663,6 +1663,9 @@ async def edit(
16631663 public_updates_channel : TextChannel | None = MISSING ,
16641664 premium_progress_bar_enabled : bool = MISSING ,
16651665 disable_invites : bool = MISSING ,
1666+ discoverable : bool = MISSING ,
1667+ disable_raid_alerts : bool = MISSING ,
1668+ enable_activity_feed : bool = MISSING ,
16661669 ) -> Guild :
16671670 r"""|coro|
16681671
@@ -1740,6 +1743,12 @@ async def edit(
17401743 Whether the guild should have premium progress bar enabled.
17411744 disable_invites: :class:`bool`
17421745 Whether the guild should have server invites enabled or disabled.
1746+ discoverable: :class:`bool`
1747+ Whether the guild should be discoverable in the discover tab.
1748+ disable_raid_alerts: :class:`bool`
1749+ Whether activity alerts for the guild should be disabled.
1750+ enable_activity_feed: class:`bool`
1751+ Whether the guild's user activity feed should be enabled.
17431752 reason: Optional[:class:`str`]
17441753 The reason for editing this guild. Shows up on the audit log.
17451754
@@ -1861,8 +1870,12 @@ async def edit(
18611870
18621871 fields ["system_channel_flags" ] = system_channel_flags .value
18631872
1873+ if premium_progress_bar_enabled is not MISSING :
1874+ fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1875+
1876+ features : list [GuildFeature ] = self .features .copy ()
1877+
18641878 if community is not MISSING :
1865- features = self .features .copy ()
18661879 if community :
18671880 if (
18681881 "rules_channel_id" in fields
@@ -1872,8 +1885,7 @@ async def edit(
18721885 features .append ("COMMUNITY" )
18731886 else :
18741887 raise InvalidArgument (
1875- "community field requires both rules_channel and"
1876- " public_updates_channel fields to be provided"
1888+ "community field requires both rules_channel and public_updates_channel fields to be provided"
18771889 )
18781890 else :
18791891 if "COMMUNITY" in features :
@@ -1883,20 +1895,43 @@ async def edit(
18831895 fields ["public_updates_channel_id" ] = None
18841896 features .remove ("COMMUNITY" )
18851897
1886- fields ["features" ] = features
1887-
1888- if premium_progress_bar_enabled is not MISSING :
1889- fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1890-
18911898 if disable_invites is not MISSING :
1892- features = self .features .copy ()
18931899 if disable_invites :
1894- if not "INVITES_DISABLED" in features :
1900+ if "INVITES_DISABLED" not in features :
18951901 features .append ("INVITES_DISABLED" )
18961902 else :
18971903 if "INVITES_DISABLED" in features :
18981904 features .remove ("INVITES_DISABLED" )
18991905
1906+ if discoverable is not MISSING :
1907+ if discoverable :
1908+ if "DISCOVERABLE" not in features :
1909+ features .append ("DISCOVERABLE" )
1910+ else :
1911+ if "DISCOVERABLE" in features :
1912+ features .remove ("DISCOVERABLE" )
1913+
1914+ if disable_raid_alerts is not MISSING :
1915+ if disable_raid_alerts :
1916+ if "RAID_ALERTS_DISABLED" not in features :
1917+ features .append ("RAID_ALERTS_DISABLED" )
1918+ else :
1919+ if "RAID_ALERTS_DISABLED" in features :
1920+ features .remove ("RAID_ALERTS_DISABLED" )
1921+
1922+ if enable_activity_feed is not MISSING :
1923+ if enable_activity_feed :
1924+ if "ACTIVITY_FEED_ENABLED_BY_USER" not in features :
1925+ features .append ("ACTIVITY_FEED_ENABLED_BY_USER" )
1926+ if "ACTIVITY_FEED_DISABLED_BY_USER" in features :
1927+ features .remove ("ACTIVITY_FEED_DISABLED_BY_USER" )
1928+ else :
1929+ if "ACTIVITY_FEED_ENABLED_BY_USER" in features :
1930+ features .remove ("ACTIVITY_FEED_ENABLED_BY_USER" )
1931+ if "ACTIVITY_FEED_DISABLED_BY_USER" not in features :
1932+ features .append ("ACTIVITY_FEED_DISABLED_BY_USER" )
1933+
1934+ if self .features != features :
19001935 fields ["features" ] = features
19011936
19021937 data = await http .edit_guild (self .id , reason = reason , ** fields )
0 commit comments