RoboHub

This page was generated from the source of RoboHub. Edit the source, not this page.

robohub-provider-telegram

An alert channel that posts each alert to a Telegram chat through a bot. It
implements the robohub.alert interface (its send), and the application calls
alert.raise(...), never the provider (see robohub-alert/index).

Binding it

deps:
  robohub:
    robohub-alert: ">=1.1.0"
    robohub-provider-telegram: ">=0.2.0"

bind:
  robohub.alert:
    providers: [robohub-provider-telegram]
    config:
      robohub-provider-telegram:
        severity_threshold: WARNING

Put bot_token and chat_id in the application's bind.conf (the settings
page writes them there) rather than in the manifest: the token is a secret.

Settings

SettingDefaultWhat it is
bot_token—The bot's token from BotFather; required
chat_id—The chat the bot posts to; required
severity_thresholdeverythingThe lowest level posted: INFO, WARNING, ERROR, CRITICAL
enabledon"false" stops the channel

The message is [<level>] <message>, with the metadata on a second line. The
token and the chat id must be what Telegram issues (letters, digits, :, -,
_); anything else is refused. The token is passed to curl through an
owner-only file, never on a command line. send answers 1 when the Bot API
accepted the message.

Release history

[0.1.0] - 2026-11-02

The Telegram provider for the alert contract.

[0.2.0] - 2026-11-12

A provider of the alert interface: the module lists robohub.alert under implements and exports send(level, message, metadata), which sends the alert to the chat in chat_id. Its settings are declared under provides.settings and read with rho_bind_config, from the binding of the application that uses it; the provider: block and the key=value; configuration string are gone, and the alert plugin that wrapped it was removed.

[0.2.1] - 2026-11-13

An alert of several lines is one message again: the text goes to curl through a file (--data-urlencode text@file) instead of an argument, which a line break split in two, so every alert the rules sent with metadata failed. The bot token is read from a configuration file only this user can read, never from the command line; the token and chat id must be what Telegram issues; an HTTP error is a failure (-f).

[0.2.2] - 2026-11-14

Its data is kept where app_workspace() says (rho 0.8.0) — the application's workspace, else ~/.rho/apps/<app> — so two applications started by hand no longer share this module's records. Needs rho 0.8.0.