Поправил рекурсию в GeneralAutoResponder

This commit is contained in:
Struchkov Mark 2023-04-09 18:15:41 +03:00
parent 2b8cbeb7cf
commit 311da47fd3
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static dev.struchkov.haiti.utils.Checker.checkEmpty; import static dev.struchkov.haiti.utils.Checker.checkEmpty;
@ -143,7 +144,9 @@ public class GeneralAutoResponder<M extends Message> {
v -> getAction(UnitRequest.of(first.get(), unitRequest.getMessage())) v -> getAction(UnitRequest.of(first.get(), unitRequest.getMessage()))
) )
.onItem().transformToUni( .onItem().transformToUni(
newRequest -> activeUnitAfter(UnitRequest.of(first.get(), unitRequest.getMessage())) (Function<UnitRequest<MainUnit, M>, Uni<? extends UnitRequest<MainUnit, M>>>) newRequest -> {
return activeUnitAfter(UnitRequest.of(newRequest.getUnit(), newRequest.getMessage()));
}
); );
} }
} }