/pingme

Send a notification via a Telegram bot - in Python, Bash, Octave/Matlab

Primary LanguagePythonMIT LicenseMIT

PingMe - A simple Telegram notifier

Simple functions / classes for Matlab (GNU Octave), Python and Bash to send markdown-formatted, optionally silent, messages via a telegram bot.
Intended to inform you about program or system states / crashes, etc.

Telegram Setup

Instructions on how to create a Telegram Bot and get your API key, as well as a message ID can be found e.g. here.

Installation

The scripts are small with minimal dependencies.

Python requires the requests package, Matlab (GNU Octave) and Bash require curl.

To intall, just drop the file into the program's PATH, or copy the function into your script

Usage

Python

pm = PingMe('apikey', 'chatid')
pm.ping('Hello from __Python__!', silent=True)

Matlab / GNU Octave

pingme('Hello from __GNU Octave__!', 'api_key','chatid', 0)

Bash

Note: Telegram API keys seem to contain a :, replace with %

pingme "Hello from __BASH__!" secretkey chatid false