aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/TelegramBotManager.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/juick/TelegramBotManager.java b/src/main/java/com/juick/TelegramBotManager.java
index 9dfea1a3..c9a2dadd 100644
--- a/src/main/java/com/juick/TelegramBotManager.java
+++ b/src/main/java/com/juick/TelegramBotManager.java
@@ -278,6 +278,7 @@ public class TelegramBotManager implements NotificationListener {
}
private void executeCommand(Integer messageId, Long userId, User user_from, String text, URI attachment) {
+ String messageTxt = "Unknown error or unsupported command";
try {
CommandResult result = commandsManager.processCommand(user_from, text, attachment);
if (result.getNewMessage().isPresent()) {
@@ -285,8 +286,7 @@ public class TelegramBotManager implements NotificationListener {
messagesService.setMessageProperty(newMessage.getMid(), newMessage.getRid(), "durovId",
String.valueOf(messageId));
}
- String messageTxt = StringUtils.isNotEmpty(result.getText()) ? result.getHtml()
- : "Unknown error or unsupported command";
+ messageTxt = StringUtils.isNotEmpty(result.getHtml()) ? result.getHtml() : result.getText();
telegramNotify(userId, messageTxt, new com.juick.model.Message());
} catch (Exception e) {
logger.warn("telegram exception", e);