@@ -1663,6 +1663,9 @@ async def edit(
1663
1663
public_updates_channel : TextChannel | None = MISSING ,
1664
1664
premium_progress_bar_enabled : bool = MISSING ,
1665
1665
disable_invites : bool = MISSING ,
1666
+ discoverable : bool = MISSING ,
1667
+ disable_raid_alerts : bool = MISSING ,
1668
+ enable_activity_feed : bool = MISSING ,
1666
1669
) -> Guild :
1667
1670
r"""|coro|
1668
1671
@@ -1740,6 +1743,12 @@ async def edit(
1740
1743
Whether the guild should have premium progress bar enabled.
1741
1744
disable_invites: :class:`bool`
1742
1745
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.
1743
1752
reason: Optional[:class:`str`]
1744
1753
The reason for editing this guild. Shows up on the audit log.
1745
1754
@@ -1861,8 +1870,12 @@ async def edit(
1861
1870
1862
1871
fields ["system_channel_flags" ] = system_channel_flags .value
1863
1872
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
+
1864
1878
if community is not MISSING :
1865
- features = self .features .copy ()
1866
1879
if community :
1867
1880
if (
1868
1881
"rules_channel_id" in fields
@@ -1872,8 +1885,7 @@ async def edit(
1872
1885
features .append ("COMMUNITY" )
1873
1886
else :
1874
1887
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"
1877
1889
)
1878
1890
else :
1879
1891
if "COMMUNITY" in features :
@@ -1883,20 +1895,43 @@ async def edit(
1883
1895
fields ["public_updates_channel_id" ] = None
1884
1896
features .remove ("COMMUNITY" )
1885
1897
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
-
1891
1898
if disable_invites is not MISSING :
1892
- features = self .features .copy ()
1893
1899
if disable_invites :
1894
- if not "INVITES_DISABLED" in features :
1900
+ if "INVITES_DISABLED" not in features :
1895
1901
features .append ("INVITES_DISABLED" )
1896
1902
else :
1897
1903
if "INVITES_DISABLED" in features :
1898
1904
features .remove ("INVITES_DISABLED" )
1899
1905
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 :
1900
1935
fields ["features" ] = features
1901
1936
1902
1937
data = await http .edit_guild (self .id , reason = reason , ** fields )
0 commit comments