mojira / arisa-kt

:robot::sparkles: Run checks and perform automated tasks in Mojira
https://bugs.mojang.com
GNU General Public License v3.0
10 stars 6 forks source link

Add shadowban command #754

Closed violine1101 closed 2 years ago

violine1101 commented 2 years ago

Purpose

Add a shadowban command to revert all actions for a specific user, for a duration of 24 hours.

Approach

Save shadowbans in last run file. I've completely reworked the last run file on the occasion. Have a module that checks for any actions of shadowbanned users on any updated ticket, by looking it up in the last run file essentially. The command just adds the ban to the last run file.

See the commit messages of the individual commits for more information.

There are some shady things I did, please review thoroughly. If you have a better idea on how to solve the communication between command and last run file, feel free to provide suggestions. I felt like threading through the last run file just for this was a bit much.

Future work

General clean up.

Checklist

violine1101 commented 2 years ago

One refactor that might be a good idea would be that we just call every module with a ModuleExecutionContext or something similar that would contain lastrun, shadowbans, the issue, etc.