Skip to content

Commit

Permalink
[FreeloaderMode] disallow the bot from deleting messages
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Jul 28, 2024
1 parent 20164cf commit 2aba2a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions freeloadermode/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ async def _tempban(
audit_reason: str = get_audit_reason(author, reason, shorten=True) # type: ignore

try:
await guild.ban(member, reason=audit_reason)
await guild.ban(
member, reason=audit_reason, delete_message_days=0, delete_message_seconds=0
)
except (discord.NotFound, discord.Forbidden, discord.HTTPException):
return
else:
Expand Down Expand Up @@ -372,7 +374,12 @@ async def on_member_remove(self, member: discord.Member) -> None:

if action.lower() == "ban":
try:
await guild.ban(member, reason="Member left while freeloader mode was toggled.")
await guild.ban(
member,
reason="Member left while freeloader mode was toggled.",
delete_message_days=0,
delete_message_seconds=0,
)
except discord.NotFound:
return
else:
Expand Down

0 comments on commit 2aba2a0

Please sign in to comment.