Telegram Notifications

Telegram is a free & open-source messenger.

This article describes Telegram configuration for CAS when operating your own CAS server to receive notifications from CAS regarding transactions and other events relevant to your BATM operation.

New notifications via Telegram were introduced in v. 20181204

  • Server: Notifications can be now delivered via Telegram.

  • Extensions: You can now talk to extensions via Telegram.

  • See ChatBotExtensionExample

To use the Telegram messenger as a notification method, perform these following steps:

1. Create a new bot in Telegram:

Search for the "BotFather" in the Telegram GUI:

Create a name for your new bot.

  • In this example, we'll use "gb_kb_example_bot".

NOTE: the bot name MUST end with the word "bot"!

In a message to BotFather, type:

/start /newbot [name of your bot]

Example:

/start
/newbot gb_kb_example_bot

  • The BotFather will now ask you to invent a "username". 

Create a descriptive name for your bot ("ExampleBot").

Save the received HTTP API token.

Example conversation:


Configure CAS from the CLI to use the new bot you created:

Create a Telegram configuration file for CAS:

sudo touch /batm/config/telegram sudo nano /batm/config/telegram

Enter the following data:

telegram_bot_username=gb_kb_example_bot telegram_bot_token=APIKey:APIToken
  • The resulting file will look like this (using our example):

  • Save the file (type Ctrl+x and save when asked).

Restart CAS:

  • The bot won't work until the CAS Admin service is running!


Setup CAS to use your new Bot:

Identify your Telegram User ID for CAS:

  1. Open Telegram and locate your new bot:

  2. Click on the start button:

  3. Receive your Telegram User ID in a reply:

Add your Telegram User ID to the appropriate CAS Person:

  • Be sure to SAVE the setting (SUBMIT).

Configure your Notification Policy:

  1. Create a Notification Rule:

  • Set the Action Parameter to the same Telegram User ID previously identified.


Troubleshooting:

You can search the master log for the TelegramBot string.  You should see the TelegramBot registering command.

Copyright © 2020-2024 General Bytes USA LLC