@@ -40,8 +40,8 @@ public final class MuteCommand extends SlashCommandAdapter {
4040 private static final String COMMAND_NAME = "mute" ;
4141 private static final String ACTION_VERB = "mute" ;
4242 private static final String PERMANENT_DURATION = "permanent" ;
43- private static final List <String > DURATIONS = List .of (PERMANENT_DURATION , "1 hour " , "3 hours " ,
44- "1 day " , "2 days " , "3 days" , "7 days" , "1 month" );
43+ private static final List <String > DURATIONS = List .of ("10 minutes" , "30 minutes " , "1 hour " ,
44+ "3 hours " , "1 day " , "3 days" , "7 days" , PERMANENT_DURATION );
4545 private final Predicate <String > hasRequiredRole ;
4646 private final ModerationActionsStore actionsStore ;
4747
@@ -106,21 +106,20 @@ private static RestAction<Boolean> sendDm(@NotNull ISnowflake target,
106106 target .getUser (), durationText + dmNoticeText , reason );
107107 }
108108
109+ // FIXME Code duplication with BanCommand, get rid of it
109110 private static @ NotNull Optional <TemporaryMuteData > computeTemporaryMuteData (
110111 @ NotNull String durationText ) {
111112 if (PERMANENT_DURATION .equals (durationText )) {
112113 return Optional .empty ();
113114 }
114115
115- // 1 day , 1 days, 1 month , ...
116+ // 1 minute , 1 day, 2 days , ...
116117 String [] data = durationText .split (" " , 2 );
117118 int duration = Integer .parseInt (data [0 ]);
118119 ChronoUnit unit = switch (data [1 ]) {
119120 case "minute" , "minutes" -> ChronoUnit .MINUTES ;
120121 case "hour" , "hours" -> ChronoUnit .HOURS ;
121122 case "day" , "days" -> ChronoUnit .DAYS ;
122- case "week" , "weeks" -> ChronoUnit .WEEKS ;
123- case "month" , "months" -> ChronoUnit .MONTHS ;
124123 default -> throw new IllegalArgumentException (
125124 "Unsupported mute duration: " + durationText );
126125 };
0 commit comments