aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-10-24 16:39:33 +0300
committerGravatar Vitaly Takmazov2021-10-24 16:39:33 +0300
commit1bca4586c8358ce7cef302c6019f112100b34393 (patch)
treecd50487a03661eb2e121755370d71bc67f9932d5 /src/main/java
parent59a5c3edb580f443c021cca03493eb9dc6c55c83 (diff)
Fixes for the top bot
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/TopManager.java6
1 files changed, 5 insertions, 1 deletions
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<String> 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());
}
});