From 9894c4e6d992a1269ef674f77e73d55248d901f0 Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Thu, 2 Jan 2025 22:22:41 +0300 Subject: [PATCH] Remove variable --- discord/guild.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index a08ed5abf2..d74b0d900c 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1875,8 +1875,6 @@ async def edit( features: list[GuildFeature] = self.features.copy() - features_modified: bool = False - if community is not MISSING: if community: if ( @@ -1896,7 +1894,6 @@ async def edit( if "public_updates_channel_id" in fields: fields["public_updates_channel_id"] = None features.remove("COMMUNITY") - features_modified = True if disable_invites is not MISSING: if disable_invites: @@ -1905,7 +1902,6 @@ async def edit( else: if "INVITES_DISABLED" in features: features.remove("INVITES_DISABLED") - features_modified = True if discoverable is not MISSING: if discoverable: @@ -1914,7 +1910,6 @@ async def edit( else: if "DISCOVERABLE" in features: features.remove("DISCOVERABLE") - features_modified = True if raid_alerts is not MISSING: if raid_alerts: @@ -1923,7 +1918,6 @@ async def edit( else: if "RAID_ALERTS_DISABLED" not in features: features.append("RAID_ALERTS_DISABLED") - features_modified = True if enable_activity_feed is not MISSING: if enable_activity_feed: @@ -1936,9 +1930,8 @@ async def edit( features.remove("ACTIVITY_FEED_ENABLED_BY_USER") if "ACTIVITY_FEED_DISABLED_BY_USER" not in features: features.append("ACTIVITY_FEED_DISABLED_BY_USER") - features_modified = True - if features_modified: + if self.features != features: fields["features"] = features data = await http.edit_guild(self.id, reason=reason, **fields)