@@ -1798,6 +1798,9 @@ async def edit(
1798
1798
public_updates_channel : TextChannel | None = MISSING ,
1799
1799
premium_progress_bar_enabled : bool = MISSING ,
1800
1800
disable_invites : bool = MISSING ,
1801
+ discoverable : bool = MISSING ,
1802
+ disable_raid_alerts : bool = MISSING ,
1803
+ enable_activity_feed : bool = MISSING ,
1801
1804
) -> Guild :
1802
1805
r"""|coro|
1803
1806
@@ -1875,6 +1878,12 @@ async def edit(
1875
1878
Whether the guild should have premium progress bar enabled.
1876
1879
disable_invites: :class:`bool`
1877
1880
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.
1878
1887
reason: Optional[:class:`str`]
1879
1888
The reason for editing this guild. Shows up on the audit log.
1880
1889
@@ -1996,8 +2005,12 @@ async def edit(
1996
2005
1997
2006
fields ["system_channel_flags" ] = system_channel_flags .value
1998
2007
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
+
1999
2013
if community is not MISSING :
2000
- features = self .features .copy ()
2001
2014
if community :
2002
2015
if (
2003
2016
"rules_channel_id" in fields
@@ -2007,8 +2020,7 @@ async def edit(
2007
2020
features .append ("COMMUNITY" )
2008
2021
else :
2009
2022
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"
2012
2024
)
2013
2025
else :
2014
2026
if "COMMUNITY" in features :
@@ -2018,20 +2030,43 @@ async def edit(
2018
2030
fields ["public_updates_channel_id" ] = None
2019
2031
features .remove ("COMMUNITY" )
2020
2032
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
-
2026
2033
if disable_invites is not MISSING :
2027
- features = self .features .copy ()
2028
2034
if disable_invites :
2029
- if not "INVITES_DISABLED" in features :
2035
+ if "INVITES_DISABLED" not in features :
2030
2036
features .append ("INVITES_DISABLED" )
2031
2037
else :
2032
2038
if "INVITES_DISABLED" in features :
2033
2039
features .remove ("INVITES_DISABLED" )
2034
2040
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 :
2035
2070
fields ["features" ] = features
2036
2071
2037
2072
data = await http .edit_guild (self .id , reason = reason , ** fields )
0 commit comments