Skip to main content

Send a notification to a Telegram user or group.

Project description

telegram_notifier_bot - v0.0.1

A simple package to send notifications to a Telegram user or group.

E.g.

  • Send notifications triggered by some event
    • in a monitoring system
    • an IoT device
    • a service

Installation

From PyPI

(venv) $ pip install telegram-notifier-bot
(venv) $

From GitHub

(venv) $ pip install git+https://github.com/p4irin/telegram_notifier_bot.git
(venv) $

Verify

(venv) $ python
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import telegram_notifier_bot
>>> telegram_notifier_bot.__version__
'0.0.1'
>>>

Usage

Prerequisite

Create a new Telegram bot

Send a notification

(venv) $ export TELEGRAM_BOT_TOKEN=<Your Telegram bot token>
(venv) $ export TELEGRAM_CHAT_ID=<Recipient(s) chat or group id>
(venv) $ python
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import telegram_notifier_bot
>>> token = os.getenv('TELEGRAM_BOT_TOKEN')
>>> chat_id = os.getenv('TELEGRAM_CHAT_ID')
>>> telegram_notifier_bot.send(token, chat_id, "We're out of coffee! Please fix ASAP!")
>>>

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_notifier_bot-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

telegram_notifier_bot-0.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file telegram_notifier_bot-0.0.1.tar.gz.

File metadata

  • Download URL: telegram_notifier_bot-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for telegram_notifier_bot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d2cfd7d8d904004ed50b62bd09b75922ad8d0b58bf232a9095e6fb4072ae3d17
MD5 885de1f72840b131e7b917a50425283b
BLAKE2b-256 7d7580323963b78157f23307fb3314b54295075274611d9a948018ce6e8fb6a7

See more details on using hashes here.

File details

Details for the file telegram_notifier_bot-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_notifier_bot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70c692fa25631b646d0761f433f88fc3bb6c04e58994fdd85f47016ae99be25b
MD5 28364786f873549ad84621bb841b95ee
BLAKE2b-256 887c1bd0b53d66d6834357f086ba5404e76c951ce0cccf244329bd0b3598bb67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page