Documentation

telegram package

The telegram package is a user-contributed package maintained by the package author.

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

import "contrib/sranka/telegram"

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 https://api.telegram.org/bot$token/getUpdates.

    curl https://api.telegram.org/bot$token/getUpdates
    

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

Options

option telegram.defaultDisableWebPagePreview = false

option telegram.defaultParseMode = "MarkdownV2"

option telegram.defaultSilent = true

option telegram.defaultURL = "https://api.telegram.org/bot"

defaultDisableWebPagePreview

defaultDisableWebPagePreview - Use Telegram web page preview by default. Default is false.

defaultParseMode

defaultParseMode is the default Telegram parse mode. Default is MarkdownV2.

defaultSilent

defaultSilent - Send silent Telegram notifications by default. Default is true.

defaultURL

defaultURL is the default Telegram bot URL. Default is https://api.telegram.org/bot.

Functions


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered