diff options
Diffstat (limited to 'juick-api/src/main/java/com')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/TelegramBotHook.java | 13 |
1 files changed, 9 insertions, 4 deletions
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 f98bbc01..29b32af2 100644 --- a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java +++ b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java @@ -165,10 +165,15 @@ public class TelegramBotHook { } else { if (user_from.getUID() == 0) { telegramSignupNotify(message.from().id().longValue(), UserQueries.getSignUpHashByTelegramID(jdbc, message.from().id().longValue(), username)); - } else if (message.text().equalsIgnoreCase("/login")) { - String msg = String.format("Hi, %s!\nTap to log in", user_from.getUName()); - String msgUrl = "http://juick.com/login?" + UserQueries.getHashByUID(jdbc, user_from.getUID()); - telegramNotify(message.from().id().longValue(), msg, msgUrl); + } else { + String text = message.text(); + if (text != null) { + if (text.equalsIgnoreCase("/login")) { + String msg = String.format("Hi, %s!\nTap to log in", user_from.getUName()); + String msgUrl = "http://juick.com/login?" + UserQueries.getHashByUID(jdbc, user_from.getUID()); + telegramNotify(message.from().id().longValue(), msg, msgUrl); + } + } } } } |