From a0f80055dbdb979eeeae4d84df933944c54aab88 Mon Sep 17 00:00:00 2001 From: Stas Parshin Date: Sat, 23 Jan 2016 20:55:10 +0700 Subject: [PATCH] HTML formatting for messages --- .../java/com/pengrad/telegrambot/model/request/ParseMode.java | 2 +- src/test/java/com/pengrad/telegrambot/TelegramBotTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/pengrad/telegrambot/model/request/ParseMode.java b/src/main/java/com/pengrad/telegrambot/model/request/ParseMode.java index 04a094ca..714af521 100644 --- a/src/main/java/com/pengrad/telegrambot/model/request/ParseMode.java +++ b/src/main/java/com/pengrad/telegrambot/model/request/ParseMode.java @@ -5,5 +5,5 @@ * 10/21/15. */ public enum ParseMode { - Markdown + Markdown, HTML } diff --git a/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java b/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java index 16f71a21..f051086b 100644 --- a/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java +++ b/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java @@ -76,6 +76,10 @@ public void testSendMessage() throws Exception { MessageTest.checkTextMessage(sendResponse.message()); sendResponse = bot.sendMessage(channelId, "explicit to channel id _italic_ *markdown*", ParseMode.Markdown, false, null, new ReplyKeyboardHide()); MessageTest.checkTextMessage(sendResponse.message()); + sendResponse = bot.sendMessage(channelName, "to channel name with html bold, bold " + + "italic, italic inline URL inline fixed-width code
pre-formatted fixed-width code block
", + ParseMode.HTML, false, null, new ReplyKeyboardHide()); + MessageTest.checkTextMessage(sendResponse.message()); } @Test