LogReader Binding with Telegram Action and Markdown format

Hey guys,

Just a quick how to about using the LogReader binding with the Telegram Action and format the messages with Markdown. Which is much more readable.

2019-05-01%2010_40_09-Window

services/telegram.cfg add the parse mode

bot3.chatId=123456
bot3.token=your_token
bot3.parseMode=Markdown

rules/logreader.rules

rule "LogReader Error"
    when
        Channel 'logreader:reader:openhablog:newErrorEvent' triggered
    then
        // do something
        sendTelegram("bot3", "*ERROR* LogReader Event!\n%s Error Warnungen im Log! Hier ist die letzte Zeile davon:\n`%s`", logreaderErrors.state.toString, logreaderLastError.state.toString)
    end

more about Markdown formats is Telegram format options

Have fun

3 Likes

Perfect, i hadn’t recognized the markdown mode yet.
Alltough it seems, that the bot or bundle does not render the inline code block currently.
Maybe this takes some time.