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

Fix range argument in $ARISA_PURGE_ATTACHMENT #762

Closed SPGoding closed 2 years ago

SPGoding commented 2 years ago

Purpose

Fix #759.

Approach

By changing the syntax of the command from

$ARISA_PURGE_ATTACHMENT <username> [<minId> [<maxId>]]

to

$ARISA_PURGE_ATTACHMENT [from <minId>] [to <maxId>] [by <username>]

This makes all eight possible combinations of ways to filter attachments legal:

$ARISA_PURGE_ATTACHMENT                   // Remove all attachments from the report.
$ARISA_PURGE_ATTACHMENT by Annoying User  // Remove all attachments uploaded by "Annoying User" from the report.
$ARISA_PURGE_ATTACHMENT from 10000
$ARISA_PURGE_ATTACHMENT from 10000 by Annoying User
$ARISA_PURGE_ATTACHMENT from 10000 to 20000
$ARISA_PURGE_ATTACHMENT from 10000 to 20000 by Annoying User
$ARISA_PURGE_ATTACHMENT to 20000
$ARISA_PURGE_ATTACHMENT to 20000 by Annoying User

Future work

Checklist

SPGoding commented 2 years ago

Yeah thanks to Mojang/brigadier#19

Marcono1234 commented 2 years ago

@SPGoding, do you want to write in the internal communication channel to inform the others about the changed syntax?