Flux telegram package

The telegram package is a user-contributed package maintained by the package author and can be updated or removed at any time.

The Flux telegram package provides functions for sending messages to Telegram using the Telegram Bot API. Import the contrib/sranka/telegram package:

import "contrib/sranka/telegram"


The contrib/sranka/telegram package provides the following options:

option telegram.defaultURL = ""
option telegram.defaultParseMode = "MarkdownV2"
option telegram.defaultDisableWebPagePreview = false
option telegram.defaultSilent = true


Default Telegram bot URL. Default is


Default Telegram parse mode. Default is MarkdownV2.


Disable Telegram web page preview by default. Default is false.


Send silent Telegram notifications by default. Default is true.


Set up a Telegram bot

The Telegram Bot API requires a bot token and a channel ID. To set up a Telegram bot and obtain the required bot token and channel ID:

  1. Create a new Telegram account or use an existing account.

  2. Create a Telegram bot.
    Telegram provides a bot token for the newly created bot.

  3. Use the Telegram application to create a new channel.

  4. Add the new bot to the channel as an Administrator. Ensure the bot has permissions necessary to post messages.

  5. Send a message to bot in the channel.

  6. Send a request to$token/getUpdates.


    Find your channel ID in the id field of the response.

Package author and maintainer

Github: @sranka
InfluxDB Slack: @sranka

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.