From 8649c960a68300dc8ebbc02920425a813d16551a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 18 Jul 2016 16:32:04 +0300 Subject: juick-api: telegram edited messages support --- juick-api/src/main/java/com/juick/api/TelegramBotHook.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'juick-api') diff --git a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java index 682001f6..f440f8bc 100644 --- a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java +++ b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java @@ -153,8 +153,11 @@ public class TelegramBotHook { Update update = BotUtils.parseUpdate(reader); Message message = update.message(); if (update.message() == null) { - logger.log(Level.SEVERE, "error parsing telegram update: " + update.toString()); - return; + message = update.editedMessage(); + if (message == null) { + logger.log(Level.SEVERE, "error parsing telegram update: " + update.toString()); + return; + } } logger.info(String.format("got telegram msg %s", message.toString())); User user_from = UserQueries.getUserByUID(jdbc, getUser(message.chat().id())).orElse(new User()); -- cgit v1.2.3