Metadata-Version: 2.1
Name: telegram-notifier-bot
Version: 0.0.1
Summary: Send a notification to a Telegram user or group.
Author-email: p4irin <139928764+p4irin@users.noreply.github.com>
Project-URL: Homepage, https://github.com/p4irin/telegram_notifier_bot
Project-URL: Bug Tracker, https://github.com/p4irin/telegram_notifier_bot/issues
Keywords: telegram,bot
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.8.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests >=2.31.0
Provides-Extra: dev
Requires-Dist: build ==0.10.0 ; extra == 'dev'
Requires-Dist: twine >=4.0.2 ; extra == 'dev'
Requires-Dist: bumpver >=2023.1126 ; extra == 'dev'
Provides-Extra: test
Requires-Dist: python-dotenv[cli] >=1.0.0 ; extra == 'test'

# 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

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

### From GitHub

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

### Verify

```bash
(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](https://core.telegram.org/bots/features#creating-a-new-bot)

### Send a notification

```bash
(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

- [The Telegram Bot API](https://core.telegram.org/bots/api)
- [Requests: HTTP for Humans](https://requests.readthedocs.io/en/latest/)
