From d354614b10ac40c77d290f46aee488851db1b48c Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 21 May 2026 17:33:10 +0300 Subject: [PATCH] Fix safety_alerts_channel typing not accepting None in Guild.edit() --- discord/guild.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 0dd999de8..8fb4e6fa1 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2027,7 +2027,7 @@ class Guild(Hashable): widget_channel: Optional[Snowflake] = MISSING, mfa_level: MFALevel = MISSING, raid_alerts_disabled: bool = MISSING, - safety_alerts_channel: TextChannel = MISSING, + safety_alerts_channel: Optional[TextChannel] = MISSING, invites_disabled_until: datetime.datetime = MISSING, dms_disabled_until: datetime.datetime = MISSING, ) -> Guild: @@ -2285,8 +2285,7 @@ class Guild(Hashable): raise TypeError( f'safety_alerts_channel must be of type TextChannel not {safety_alerts_channel.__class__.__name__}' ) - - fields['safety_alerts_channel_id'] = safety_alerts_channel.id + fields['safety_alerts_channel_id'] = safety_alerts_channel.id if owner is not MISSING: if self.owner_id != self._state.self_id: