← Back

WBPP Telegram Notifications

By Luca Bartek, Marco Manenti


Adds Telegram bot integration to WBPP pipelines, sending real-time status messages and images at key execution points. [more]

Keywords: WBPP, Telegram, Notifications, PixInsight, Pipeline, Automation

Contents

[hide]

1 Introduction

[hide]

This extension adds Telegram notification support to the Weighted Batch Preprocessing (WBPP) process. Notifications inform the user about pipeline progress, completion, and errors in real time via Telegram messages. This is particularly helpful for long unattended processing tasks or remote system operation.

2 Setup

[hide]

To use Telegram notifications, follow these steps:

  • Open the Pipeline tab in WBPP.
  • Add an Event Script. Use the script
    NotificationEventScript.js
    , available in the TheSpaceKoala PixInsight repository. After downloading the scripts, you'll find it together in the PixInsight scripts directory.
  • Open the script in a text editor. Modify the following two lines at the top:
  • const TELEGRAM_BOT_TOKEN = 'your-token-here';
  • const TELEGRAM_CHAT_ID = 'your-chat-id-here';
  • Save the script with these changes.
  • It is recommended that you duplicate the script (e.g., MyTelegramEventScript.js) into another location and use that instead to avoid overwriting your settings during updates.

Setting Up a Telegram Bot

  • Open Telegram and search for BotFather.
  • Start a chat and type: /newbot.
  • Follow the instructions to create a bot and receive an API token, e.g. 63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c.
  • Copy the bot token; you will need it for the script.

Finding Your Telegram Chat ID

  • Start a new chat with your newly created bot.
  • Visit the website: https://api.telegram.org/bot/getUpdates (replace with the actual token from BotFather).
  • You will receive a JSON response similar to this:

"ok": true,
"result": [
{
"update_id": 83xxxxx35,
"message": {
"message_id": 2643,
"from": {...},
"chat": {
"id": 123456789,
"first_name": "...",
"last_name": "...",
"username": "@username",
"type": "private"
},
"date": 1703062972,
"text": "/start"
} } ]}

  • The number you get in the chat section in the id field is your Telegram Chat ID.

3 Message Types

[hide]

The script supports the following notification types:

  • Start Notification — Sent when the WBPP pipeline begins.
  • Step Notifications — Sent when each WBPP step starts or completes.
  • Error Notification — Sent immediately when an error occurs.
  • Completion Notification — Sent when the pipeline finishes successfully.
  • Image Notification — A JPEG preview of the final stacked image is downsampled, autostretched, and sent via Telegram.

4 Message Content

[hide]

Notifications typically include:

  • Current WBPP step
  • Operation status summary
  • Error message (in case of failure)

Example messages:

WBPP started
ImageIntegration starting: processing 48/62 active frames
LocalNormalization failed, Cannot open reference image
WBPP terminated
ImageIntegration successfully executed

5 Limitations

[hide]

  • Telegram integration requires external network access and uses the curl utility.
  • If the bot token or chat ID is invalid, no message is sent.
  • Messages are silently skipped if configuration is missing.

Important Notice: The previous Telegram notification script is now deprecated. We recommend switching to the new

NotificationEventScript.js

, which is more flexible and powerful, offering support for multiple platforms and advanced configuration options.