1. Notifications
  2. Telegram

Notifications

Telegram

Sending Telegram messages on the Stubber platform.

Telegram enables powerful notifications in Stubber through its flexible Bot platform.

Unique features of Telegram Bots in Stubber:

  1. Unlimited number of bots can be created and configured
  2. Users can find your bots on Telegram by searching for them
  3. Bots can initiate conversation with any user that has spoken to your bot
  4. Bots can be added to and participate in group chats

How does a Telegram Bot work?

You set up your bot via BotFather on Telegram and configure the bots name, profile image and other settings.

We recommend choosing a professional name and profile picture for your bot to build user trust.

You add the bot to your Stubber Profile on Manage here. Once the setup is complete you then configure your bot to route to your template. We recommend following our Telegram Bot Setup Tutorial when setting up a bot for the first time.

How many bots can you use?

There’s no limit to the number of bots you can set up on Telegram or add to the Stubber platform. However, we recommend creating and configuring only as many bots as you actually need.

How is the routing setup for a Telegram bot?

Within your Telegram Bot Profile in Manage you are able to set the routes for a bot. All your available routes are listed on the bots profile page.

Every bot will have a private route that is configurable by default. The private route is used for one-on-one chats between the bot and a telegram user.

Whenever a bot is added to a group chat, the group is added to your bot profile page and is ready to be configured. A single bot can handle a single private route and multiple group routes depending on the use case.

Inner workings

Telegram bots work through the Telegram Bot API. When a message is sent to a bot, it is routed to the Stubber platform, which processes the message and sends appropriate responses back through the bot.

Your bot can send messages to any user who has previously initiated a conversation with it.

Routing incoming Telegram messages

Incoming messages are integrated into Stubber using a feedback action called _update_from_telegram. This feedback action is triggered when a message is sent to a Telegram bot that is correctly configured on your Stubber profile.

TIP

See the Update From Telegram Feedback Action for more information on how to receive Telegram messages on the Stubber platform.

Basic Usage

We have setup all the basic Telegram notifications in the Notifications Library for you to make use of when setting up your templates.

Send message out

loading...

Send media out

loading...

Parameters

The Telegram parameters are intentionally kept simple.

Everything inside platforms.telegram should be considered parameters for this notification.


text
required for text messages
string

The text that is sent out

Default: null


media
required for media messages
object

Contains the media files to be sent

Show child attributes
files
required
array

An array of file objects or file UUIDs to send.

Example:

loading...

bot_username
optional
string

If you have multiple Telegram bots set up on your org, you can use this parameter to specify the bot_username to use for the outgoing message.


bot_id
optional
string

If you have multiple Telegram bots set up on your org, you can use this parameter to specify the bot_id to use for the outgoing message.


stubsession
optional
object

Contains the properties that relate to the handling of client's stubsession. The stubsession is what is used to determine where a client's incoming Telegram message should go. If you set the stubsession on an outgoing Telegram message, all incoming replies for the duration of the stubsession will be returned to the stub the outgoing message was sent from.

Default: null


stubsession.set_new_with_timeout_hours
optional
integer

Length in hours for the Telegram stubsession to remain open.

Default: null


stubsession.cancel_current_existing_stubsession
optional
boolean

This can be set to true to cancel the current stubsession for a specific chat_id (client).

Default: false


stubsession.set_nextreply_with_timeout_minutes
optional
integer

This can be used to "steal" the stubsession for a specific chat_id (client), but only for their next reply. After their next reply, their stubsession will return to what it was.

Default: false


stubsession.specificreply_uuid
optional
string

If this parameter is supplied, incoming replies from the client will not be posted to the stub in their stubsession. This parameter makes it easy to run actions on any stub in your org for incoming messages, as opposed to specifically on the stub the message was sent from.

Incoming replies will emit on heimdall on a specific path, determined by the specificreply_uuid. You can then register on this path to run a specific action on any stub in your org.

Default: null


stubsession.set_stubsession_stubref
optional
string

This parameter can be used to set the stubsession to a specific stub in your org. This is useful when you want to route the next incoming messages to a specific stub in your org. Setting this parameter will override the default behavior of the stubsession being set to the stub the message was sent from.

Default: null


Previous <- SMS