Skip to content

Commit 126c40e

Browse files
committed
Rebase on develop
* added /warn action that was added in the meantime
1 parent 50504a5 commit 126c40e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public enum ModerationAction {
1818
* When a user kicks another user.
1919
*/
2020
KICK("kicked"),
21+
/**
22+
* When a user warns another user.
23+
*/
24+
WARN("warned"),
2125
/**
2226
* When a user mutes another user.
2327
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void warnUser(@NotNull User target, @NotNull Member author, @NotNull Str
8484
reason);
8585

8686
actionsStore.addAction(guild.getIdLong(), author.getIdLong(), target.getIdLong(),
87-
ModerationUtils.Action.WARN, null, reason);
87+
ModerationAction.WARN, null, reason);
8888
}
8989

9090
private static @NotNull MessageEmbed sendFeedback(boolean hasSentDm, @NotNull User target,
@@ -93,8 +93,8 @@ private void warnUser(@NotNull User target, @NotNull Member author, @NotNull Str
9393
if (!hasSentDm) {
9494
dmNoticeText = "(Unable to send them a DM.)";
9595
}
96-
return ModerationUtils.createActionResponse(author.getUser(), ModerationUtils.Action.WARN,
97-
target, dmNoticeText, reason);
96+
return ModerationUtils.createActionResponse(author.getUser(), ModerationAction.WARN, target,
97+
dmNoticeText, reason);
9898
}
9999

100100
@Override

0 commit comments

Comments
 (0)