diff options
author | Vitaly Takmazov | 2020-01-01 13:34:25 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-01-01 13:34:25 +0300 |
commit | dcf13e9720b8a961817e1c771e7395afb35ffef6 (patch) | |
tree | 9c40a136b52b9d239a4197e497b13666f70a3525 | |
parent | 535f732f1aa2a150b6b766c77257689060073f8b (diff) |
telegram: MarkdownV2 mode
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | src/main/java/com/juick/server/TelegramBotManager.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle index 9e2834a5..f0a514c7 100644 --- a/build.gradle +++ b/build.gradle @@ -148,7 +148,7 @@ dependencies { compile 'org.apache.commons:commons-email:1.5' compile 'com.github.scribejava:scribejava-apis:6.9.0' - compile 'com.github.pengrad:java-telegram-bot-api:4.4.0' + compile 'com.github.pengrad:java-telegram-bot-api:4.5.0' compile 'com.twelvemonkeys.imageio:imageio-jpeg:3.4.2' compile 'org.imgscalr:imgscalr-lib:4.2' compile 'org.twitter4j:twitter4j-core:4.0.7' diff --git a/src/main/java/com/juick/server/TelegramBotManager.java b/src/main/java/com/juick/server/TelegramBotManager.java index f8948a68..b0d6774d 100644 --- a/src/main/java/com/juick/server/TelegramBotManager.java +++ b/src/main/java/com/juick/server/TelegramBotManager.java @@ -302,7 +302,7 @@ public class TelegramBotManager implements NotificationListener { if (replyTo > 0) { telegramPhoto.replyToMessageId(replyTo); } - telegramPhoto.parseMode(ParseMode.Markdown); + telegramPhoto.parseMode(ParseMode.MarkdownV2); if(msg.length() < 1024) { telegramPhoto.caption(msg); isSendTxt = false; @@ -324,7 +324,7 @@ public class TelegramBotManager implements NotificationListener { if (replyTo > 0) { telegramMessage.replyToMessageId(replyTo); } - telegramMessage.parseMode(ParseMode.Markdown).disableWebPagePreview(true); + telegramMessage.parseMode(ParseMode.MarkdownV2).disableWebPagePreview(true); bot.execute(telegramMessage, new Callback<>() { @Override public void onResponse(SendMessage request, SendResponse response) { @@ -377,7 +377,7 @@ public class TelegramBotManager implements NotificationListener { String.format("You are subscribed to all Juick messages. " + "[Create or link](http://juick.com/signup?type=durov&hash=%s) " + "an existing Juick account to get your subscriptions and ability to post messages", hash)) - .parseMode(ParseMode.Markdown), new Callback<>() { + .parseMode(ParseMode.MarkdownV2), new Callback<>() { @Override public void onResponse(SendMessage request, SendResponse response) { logger.info("got response: {}", response.message()); |