Telegram Bot Utilities – examples: Parsing text

Parsing text: Markdown

public static void main(String[] args) throws GettingUpdatesException, IOException {
    String yourToken = "YOUR TOKEN";
    TelegramBot b = new TelegramBot(yourToken);
    b.sendMessage("chat_id", "*Bold markdown text*", "Markdown", false, false, 0, null);
}

Parsing text: Html

public static void main(String[] args) throws GettingUpdatesException, IOException {
    String yourToken = "YOUR TOKEN";
    TelegramBot b = new TelegramBot(yourToken);
    b.sendMessage("chat_id", "<b>Bold html text</b>", "html", false, false, 0, null);
}

Here you can see the result:

Telegram bot utilities examples: parsing text
Parsing text

For info on available tags: https://core.telegram.org/bots/api#formatting-options

Previous Entries Telegram Bots Utilities - examples: custom keyboard Next Entries Telegram Bot Utilities - examples: Inline Query

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.