Skip to content

Commit 5e43ab4

Browse files
committed
bugfix temp action revocation using wrong type
* when revoking a temp action (BAN), the revocation has to be logged with the opposing type (UNBAN) for /audit
1 parent 10d4a7e commit 5e43ab4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/moderation/temp/TemporaryModerationRoutine.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ private void revokeAction(@NotNull RevocationGroupIdentifier groupIdentifier) {
125125
@NotNull ModerationAction actionType) {
126126
logger.info("Revoked temporary action {} against user '{}' ({}).", actionType,
127127
target.getAsTag(), target.getId());
128+
RevocableModerationAction action = getRevocableActionByType(actionType);
128129

129130
String reason = "Automatic revocation of temporary action.";
130131
actionsStore.addAction(guild.getIdLong(), jda.getSelfUser().getIdLong(), target.getIdLong(),
131-
actionType, null, reason);
132+
action.getRevokeType(), null, reason);
132133

133-
return getRevocableActionByType(actionType).revokeAction(guild, target, reason);
134+
return action.revokeAction(guild, target, reason);
134135
}
135136

136137
private void handleFailure(@NotNull Throwable failure,

0 commit comments

Comments
 (0)