riemann.telegram
Send events to Telegram
telegram
(telegram opts)
Send events to Telegram chat. Uses your bot token and returns a function, which send message through API to specified chat.
Format event (or events) to string with markdown syntax by default.
Telegram bots API documentation: https://core.telegram.org/bots/api
Options:
:token
The telegram token:http-options
clj-http extra options (optional):telegram-options
These options are merged with the:form-params
key of the request. The:chat_id
key is mandatory. By default, the:parse_mode
key is “Markdown”.:message-formatter
A function accepting an event and returning a string. (optional). If not specified,html-parse-mode
ormarkdown-parse-mode
will be used, depending on the:parse_mode
value.
Usage:
(def token "define_your_token")
(def chat-id "0123456")
(streams
(telegram {:token token
:telegram-options {:chat_id chat-id
:parse_mode "HTML"}}))