@@ -126,6 +126,19 @@ private void revokeAction(@NotNull RevocationGroupIdentifier groupIdentifier) {
126
126
}, failure -> handleFailure (failure , groupIdentifier ));
127
127
}
128
128
129
+ private @ NotNull RestAction <Void > executeRevocation (@ NotNull Guild guild , @ NotNull User target ,
130
+ @ NotNull ModerationAction actionType ) {
131
+ logger .info ("Revoked temporary action {} against user '{}' ({})." , actionType ,
132
+ target .getAsTag (), target .getId ());
133
+ RevocableModerationAction action = getRevocableActionByType (actionType );
134
+
135
+ String reason = "Automatic revocation of temporary action." ;
136
+ actionsStore .addAction (guild .getIdLong (), jda .getSelfUser ().getIdLong (), target .getIdLong (),
137
+ action .getRevokeType (), null , reason );
138
+
139
+ return action .revokeAction (guild , target , reason );
140
+ }
141
+
129
142
private void handleFailure (@ NotNull Throwable failure ,
130
143
@ NotNull RevocationGroupIdentifier groupIdentifier ) {
131
144
if (failure instanceof ErrorResponseException errorResponseException
@@ -140,19 +153,6 @@ private void handleFailure(@NotNull Throwable failure,
140
153
groupIdentifier .targetId , failure );
141
154
}
142
155
143
- private @ NotNull RestAction <Void > executeRevocation (@ NotNull Guild guild , @ NotNull User target ,
144
- @ NotNull ModerationAction actionType ) {
145
- logger .info ("Revoked temporary action {} against user '{}' ({})." , actionType ,
146
- target .getAsTag (), target .getId ());
147
- RevocableModerationAction action = getRevocableActionByType (actionType );
148
-
149
- String reason = "Automatic revocation of temporary action." ;
150
- actionsStore .addAction (guild .getIdLong (), jda .getSelfUser ().getIdLong (), target .getIdLong (),
151
- action .getRevokeType (), null , reason );
152
-
153
- return action .revokeAction (guild , target , reason );
154
- }
155
-
156
156
private @ NotNull RevocableModerationAction getRevocableActionByType (
157
157
@ NotNull ModerationAction type ) {
158
158
return Objects .requireNonNull (typeToRevocableAction .get (type ),
0 commit comments