diff --git a/discord/guild.py b/discord/guild.py index 2faea68034..6a3a51e833 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3071,7 +3071,9 @@ async def ban( "delete_message_seconds and delete_message_days are mutually exclusive." ) - if not (0 <= delete_message_seconds <= 604800): + if delete_message_seconds is not None and not ( + 0 <= delete_message_seconds <= 604800 + ): raise TypeError( "delete_message_seconds must be between 0 and 604800 seconds." ) diff --git a/discord/member.py b/discord/member.py index 9766ff73ae..628002a702 100644 --- a/discord/member.py +++ b/discord/member.py @@ -663,7 +663,8 @@ def timed_out(self) -> bool: async def ban( self, *, - delete_message_days: Literal[0, 1, 2, 3, 4, 5, 6, 7] = 1, + delete_message_seconds: int | None = None, + delete_message_days: Literal[0, 1, 2, 3, 4, 5, 6, 7] | None = None, reason: str | None = None, ) -> None: """|coro| @@ -671,7 +672,10 @@ async def ban( Bans this member. Equivalent to :meth:`Guild.ban`. """ await self.guild.ban( - self, reason=reason, delete_message_days=delete_message_days + self, + reason=reason, + delete_message_seconds=delete_message_seconds, + delete_message_days=delete_message_days, ) async def unban(self, *, reason: str | None = None) -> None: