From 1bca4586c8358ce7cef302c6019f112100b34393 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 24 Oct 2021 16:39:33 +0300 Subject: Fixes for the top bot --- src/main/java/com/juick/TopManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/juick/TopManager.java b/src/main/java/com/juick/TopManager.java index 0bece960..3a6cafe1 100644 --- a/src/main/java/com/juick/TopManager.java +++ b/src/main/java/com/juick/TopManager.java @@ -22,11 +22,15 @@ import com.juick.model.Message; import com.juick.model.Tag; import com.juick.model.User; import com.juick.service.MessagesService; + +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Scheduled; import javax.inject.Inject; + +import java.net.URI; import java.util.List; import java.util.stream.Collectors; @@ -46,7 +50,7 @@ public class TopManager { Message jmsg = messagesService.getMessage(m).orElseThrow(IllegalStateException::new); List tags = jmsg.getTags().stream().map(Tag::getName).map(String::toLowerCase).collect(Collectors.toList()); if (!tags.contains("juick")) { - CommandResult result = commandsManager.commandRecommend(serviceUser, null, String.valueOf(m)); + CommandResult result = commandsManager.commandRecommend(serviceUser, URI.create(StringUtils.EMPTY), String.valueOf(m)); logger.info("Popular message {}: {}", m, result.getText()); } }); -- cgit v1.2.3