@@ -1599,6 +1599,9 @@ async def edit(
1599
1599
public_updates_channel : TextChannel | None | utils .Undefined = MISSING ,
1600
1600
premium_progress_bar_enabled : bool | utils .Undefined = MISSING ,
1601
1601
disable_invites : bool | utils .Undefined = MISSING ,
1602
+ discoverable : bool | utils .Undefined = MISSING ,
1603
+ disable_raid_alerts : bool | utils .Undefined = MISSING ,
1604
+ enable_activity_feed : bool | utils .Undefined = MISSING ,
1602
1605
) -> Guild :
1603
1606
r"""|coro|
1604
1607
@@ -1676,6 +1679,12 @@ async def edit(
1676
1679
Whether the guild should have premium progress bar enabled.
1677
1680
disable_invites: :class:`bool`
1678
1681
Whether the guild should have server invites enabled or disabled.
1682
+ discoverable: :class:`bool`
1683
+ Whether the guild should be discoverable in the discover tab.
1684
+ disable_raid_alerts: :class:`bool`
1685
+ Whether activity alerts for the guild should be disabled.
1686
+ enable_activity_feed: class:`bool`
1687
+ Whether the guild's user activity feed should be enabled.
1679
1688
reason: Optional[:class:`str`]
1680
1689
The reason for editing this guild. Shows up on the audit log.
1681
1690
@@ -1785,8 +1794,12 @@ async def edit(
1785
1794
1786
1795
fields ["system_channel_flags" ] = system_channel_flags .value
1787
1796
1797
+ if premium_progress_bar_enabled is not MISSING :
1798
+ fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1799
+
1800
+ features : list [GuildFeature ] = self .features .copy ()
1801
+
1788
1802
if community is not MISSING :
1789
- features = self .features .copy ()
1790
1803
if community :
1791
1804
if "rules_channel_id" in fields and "public_updates_channel_id" in fields :
1792
1805
if "COMMUNITY" not in features :
@@ -1803,20 +1816,43 @@ async def edit(
1803
1816
fields ["public_updates_channel_id" ] = None
1804
1817
features .remove ("COMMUNITY" )
1805
1818
1806
- fields ["features" ] = features
1807
-
1808
- if premium_progress_bar_enabled is not MISSING :
1809
- fields ["premium_progress_bar_enabled" ] = premium_progress_bar_enabled
1810
-
1811
1819
if disable_invites is not MISSING :
1812
- features = self .features .copy ()
1813
1820
if disable_invites :
1814
- if not "INVITES_DISABLED" in features :
1821
+ if "INVITES_DISABLED" not in features :
1815
1822
features .append ("INVITES_DISABLED" )
1816
1823
else :
1817
1824
if "INVITES_DISABLED" in features :
1818
1825
features .remove ("INVITES_DISABLED" )
1819
1826
1827
+ if discoverable is not MISSING :
1828
+ if discoverable :
1829
+ if "DISCOVERABLE" not in features :
1830
+ features .append ("DISCOVERABLE" )
1831
+ else :
1832
+ if "DISCOVERABLE" in features :
1833
+ features .remove ("DISCOVERABLE" )
1834
+
1835
+ if disable_raid_alerts is not MISSING :
1836
+ if disable_raid_alerts :
1837
+ if "RAID_ALERTS_DISABLED" not in features :
1838
+ features .append ("RAID_ALERTS_DISABLED" )
1839
+ else :
1840
+ if "RAID_ALERTS_DISABLED" in features :
1841
+ features .remove ("RAID_ALERTS_DISABLED" )
1842
+
1843
+ if enable_activity_feed is not MISSING :
1844
+ if enable_activity_feed :
1845
+ if "ACTIVITY_FEED_ENABLED_BY_USER" not in features :
1846
+ features .append ("ACTIVITY_FEED_ENABLED_BY_USER" )
1847
+ if "ACTIVITY_FEED_DISABLED_BY_USER" in features :
1848
+ features .remove ("ACTIVITY_FEED_DISABLED_BY_USER" )
1849
+ else :
1850
+ if "ACTIVITY_FEED_ENABLED_BY_USER" in features :
1851
+ features .remove ("ACTIVITY_FEED_ENABLED_BY_USER" )
1852
+ if "ACTIVITY_FEED_DISABLED_BY_USER" not in features :
1853
+ features .append ("ACTIVITY_FEED_DISABLED_BY_USER" )
1854
+
1855
+ if self .features != features :
1820
1856
fields ["features" ] = features
1821
1857
1822
1858
data = await http .edit_guild (self .id , reason = reason , ** fields )
@@ -2224,7 +2260,7 @@ async def templates(self) -> list[Template]:
2224
2260
Forbidden
2225
2261
You don't have permissions to get the templates.
2226
2262
"""
2227
- from .template import Template # noqa: PLC0415
2263
+ from .template import Template
2228
2264
2229
2265
data = await self ._state .http .guild_templates (self .id )
2230
2266
return [Template (data = d , state = self ._state ) for d in data ]
@@ -2247,7 +2283,7 @@ async def webhooks(self) -> list[Webhook]:
2247
2283
You don't have permissions to get the webhooks.
2248
2284
"""
2249
2285
2250
- from .webhook import Webhook # noqa: PLC0415
2286
+ from .webhook import Webhook
2251
2287
2252
2288
data = await self ._state .http .guild_webhooks (self .id )
2253
2289
return [Webhook .from_state (d , state = self ._state ) for d in data ]
@@ -2337,7 +2373,7 @@ async def create_template(self, *, name: str, description: str | utils.Undefined
2337
2373
description: :class:`str`
2338
2374
The description of the template.
2339
2375
"""
2340
- from .template import Template # noqa: PLC0415
2376
+ from .template import Template
2341
2377
2342
2378
payload = {"name" : name }
2343
2379
0 commit comments