Skip to content

Commit 33fb776

Browse files
nltbeenltbee
authored andcommitted
Revert "Adding /quarantine and /unquarantine (#398)"
This reverts commit dff6068.
1 parent dfa3696 commit 33fb776

13 files changed

Lines changed: 102 additions & 570 deletions

application/config.json.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121
"channelPattern": "tj_suggestions",
2222
"upVoteEmoteName": "peepo_yes",
2323
"downVoteEmoteName": "peepo_no"
24-
},
25-
"quarantinedRolePattern": "Quarantined"
24+
}
2625
}

application/src/main/java/org/togetherjava/tjbot/commands/Features.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public enum Features {
6969
features.add(new SuggestionsUpDownVoter(config));
7070

7171
// Event receivers
72-
features.add(new RejoinModerationRoleListener(actionsStore, config));
72+
features.add(new RejoinMuteListener(actionsStore, config));
7373

7474
// Slash commands
7575
features.add(new PingCommand());
@@ -89,8 +89,6 @@ public enum Features {
8989
features.add(new RoleSelectCommand());
9090
features.add(new NoteCommand(actionsStore, config));
9191
features.add(new RemindCommand(database));
92-
features.add(new QuarantineCommand(actionsStore, config));
93-
features.add(new UnquarantineCommand(actionsStore, config));
9492

9593
// Mixtures
9694
features.add(new FreeCommand(config));

application/src/main/java/org/togetherjava/tjbot/commands/moderation/ModerationAction.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ public enum ModerationAction {
3030
* When a user unmutes another user.
3131
*/
3232
UNMUTE("unmuted"),
33-
/**
34-
* When a user quarantines another user.
35-
*/
36-
QUARANTINE("quarantined"),
37-
/**
38-
* When a user unquarantines another user.
39-
*/
40-
UNQUARANTINE("unquarantined"),
4133
/**
4234
* When a user writes a note about another user.
4335
*/

application/src/main/java/org/togetherjava/tjbot/commands/moderation/ModerationUtils.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -348,32 +348,6 @@ public static Predicate<String> getIsMutedRolePredicate(@NotNull Config config)
348348
return guild.getRoles().stream().filter(role -> isMutedRole.test(role.getName())).findAny();
349349
}
350350

351-
/**
352-
* Gets a predicate that identifies the role used to quarantine a member in a guild.
353-
*
354-
* @param config the config used to identify the quarantined role
355-
* @return predicate that matches the name of the quarantined role
356-
*/
357-
public static Predicate<String> getIsQuarantinedRolePredicate(@NotNull Config config) {
358-
return Pattern.compile(config.getQuarantinedRolePattern()).asMatchPredicate();
359-
}
360-
361-
/**
362-
* Gets the role used to quarantine a member in a guild.
363-
*
364-
* @param guild the guild to get the quarantined role from
365-
* @param config the config used to identify the quarantined role
366-
* @return the quarantined role, if found
367-
*/
368-
public static @NotNull Optional<Role> getQuarantinedRole(@NotNull Guild guild,
369-
@NotNull Config config) {
370-
Predicate<String> isQuarantinedRole = getIsQuarantinedRolePredicate(config);
371-
return guild.getRoles()
372-
.stream()
373-
.filter(role -> isQuarantinedRole.test(role.getName()))
374-
.findAny();
375-
}
376-
377351
/**
378352
* Computes a temporary data wrapper representing the action with the given duration.
379353
*

application/src/main/java/org/togetherjava/tjbot/commands/moderation/MuteCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private void muteUserFlow(@NotNull Member target, @NotNull Member author,
129129
@NotNull Guild guild, @NotNull SlashCommandEvent event) {
130130
sendDm(target, temporaryData, reason, guild, event)
131131
.flatMap(hasSentDm -> muteUser(target, author, temporaryData, reason, guild)
132-
.map(result -> hasSentDm))
132+
.map(banResult -> hasSentDm))
133133
.map(hasSentDm -> sendFeedback(hasSentDm, target, author, temporaryData, reason))
134134
.flatMap(event::replyEmbeds)
135135
.queue();

application/src/main/java/org/togetherjava/tjbot/commands/moderation/QuarantineCommand.java

Lines changed: 0 additions & 156 deletions
This file was deleted.

application/src/main/java/org/togetherjava/tjbot/commands/moderation/RejoinModerationRoleListener.java

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)