Skip to content

Commit a0f8005

Browse files
committed
HTML formatting for messages
1 parent 38cdf3d commit a0f8005

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/com/pengrad/telegrambot/model/request/ParseMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
* 10/21/15.
66
*/
77
public enum ParseMode {
8-
Markdown
8+
Markdown, HTML
99
}

src/test/java/com/pengrad/telegrambot/TelegramBotTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public void testSendMessage() throws Exception {
7676
MessageTest.checkTextMessage(sendResponse.message());
7777
sendResponse = bot.sendMessage(channelId, "explicit to channel id _italic_ *markdown*", ParseMode.Markdown, false, null, new ReplyKeyboardHide());
7878
MessageTest.checkTextMessage(sendResponse.message());
79+
sendResponse = bot.sendMessage(channelName, "to channel name with html <b>bold</b>, <strong>bold</strong> " +
80+
"<i>italic</i>, <em>italic</em> <a href=\"https://telegram.org\">inline URL</a> <code>inline fixed-width code</code> <pre>pre-formatted fixed-width code block</pre>",
81+
ParseMode.HTML, false, null, new ReplyKeyboardHide());
82+
MessageTest.checkTextMessage(sendResponse.message());
7983
}
8084

8185
@Test

0 commit comments

Comments
 (0)