aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/juick/api/TelegramBotHook.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/juick/api/TelegramBotHook.java b/src/main/java/com/juick/api/TelegramBotHook.java
index 2d64b83e..7ee759eb 100644
--- a/src/main/java/com/juick/api/TelegramBotHook.java
+++ b/src/main/java/com/juick/api/TelegramBotHook.java
@@ -83,6 +83,17 @@ public class TelegramBotHook {
if (!chats.contains(message.chat().id())) {
chats.add(message.chat().id());
logger.info("added chat with " + message.from().firstName());
+ bot.execute(new SendMessage(message.chat().id(), "Subscribed!"), new Callback<SendMessage, SendResponse>() {
+ @Override
+ public void onResponse(SendMessage request, SendResponse response) {
+ logger.info("got response: " + response.message().toString());
+ }
+
+ @Override
+ public void onFailure(SendMessage request, IOException e) {
+ logger.log(Level.WARNING, "telegram failure", e);
+ }
+ });
}
}
}