Metadata-Version: 2.1
Name: telegram_messager
Version: 0.0.2
Summary: Simplest util to send messages and documents to Telegram
Home-page: https://github.com/PasaOpasen/telegram-messager
Author: Demetry Pascal
Author-email: qtckpuhdsa@gmail.com
Maintainer: Demetry Pascal
License: MIT
Keywords: telegram,bot
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown

# telegram-messager


Simplest util to send messages to Telegram.

Usage:
```python
from telegram_messager import TelegramMessager

TM = TelegramMessager(token='token', chatid='chatid')
TM.send_msg('message')
```


## How to create bot and channel for it

1. Create a bot by BotFather, get its `TOKEN`
2. Make public channel with `@SomeChannelName`, add this bot as admin
3. Get this `ChatId` by visiting https://api.telegram.org/botTOKEN/sendMessage?chat_id=@SomeChannelName&text=123 (with replaces):
```sh
TOKEN=t
CHANNEL=c
curl "https://api.telegram.org/bot${TOKEN}/sendMessage?chat_id=${CHANNEL}&text=123" | jq '.result.chat.id'
```
4. Make channel private (if necessary)
5. Now u can send messages to this channel by command `curl -s -X POST https://api.telegram.org/botTOKEN/sendMessage -d chat_id=ChatId -d text="your message"`
