python-discord / bot

The community bot for the Python Discord community
https://pythondiscord.com
MIT License
1.36k stars 671 forks source link

Automatically apply pardoned timeouts upon rejoining the server #2963

Open shtlrs opened 7 months ago

shtlrs commented 7 months ago

This has been originally raised by @vivekashok1221 here

The current scenario is this

Scenario

  1. A user is muted for 4 days
  2. The user leaves the server
  3. Someone with the right perms pardons the unmute
  4. The user rejoins the server

    Problem

    Step 3 will only pardon the infraction in our database, but the native discord timeout will still remain in place since we cannot edit that when a user is not a Member of our server. This means that someone would have to manually unmute the user.

wookie184 commented 6 months ago

This should probably just require adding something like

elif <user_has_timeout>:
    <remove_user_timeout>

here https://github.com/python-discord/bot/blob/3c7701a64c708ad1c4acf0c8604400721aee830c/bot/exts/moderation/infraction/infractions.py#L650-L672

wookie184 commented 5 months ago

@lxnn Hi, any update on this?

lxnn commented 4 months ago

Hi @wookie184, I'm so sorry. I only got as far as starting to familiarise myself with the codebase to work on this issue and then it fell by the way-side. I've un-assigned myself from the issue.