Simplest util to send messages and documents to Telegram
Project description
telegram-messager
Simplest util to send messages to Telegram.
Usage:
from telegram_messager import TelegramMessager
TM = TelegramMessager(token='token', chatid='chatid')
TM.send_msg('message')
How to create bot and channel for it
- Create a bot by BotFather, get its
TOKEN
- Make public channel with
@SomeChannelName
, add this bot as admin - Get this
ChatId
by visiting https://api.telegram.org/botTOKEN/sendMessage?chat_id=@SomeChannelName&text=123 (with replaces):
TOKEN=t
CHANNEL=c
curl "https://api.telegram.org/bot${TOKEN}/sendMessage?chat_id=${CHANNEL}&text=123" | jq '.result.chat.id'
- Make channel private (if necessary)
- 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"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file telegram_messager-0.0.2.tar.gz
.
File metadata
- Download URL: telegram_messager-0.0.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d6950a8890623777444d19ac61a19a0f82755523e9a97deb3fed5d288df07c |
|
MD5 | 65d4fa116d08bc75e36c033b6b0f63d4 |
|
BLAKE2b-256 | 3ca9da1399da7fdf27ceacd904941aeed4439cfceecd7797e6f854a4cdd664ba |
Provenance
File details
Details for the file telegram_messager-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: telegram_messager-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c313f1501ecabc18c17d1570a842cbef059b3838a5eb6043f100fac175bfbf |
|
MD5 | 59d3c1c2183988d10d2753d9166ac0f4 |
|
BLAKE2b-256 | d34a1e926603e52aba2d00232e3822f69e21b53140fa14195f9a0c75bb2f5cc3 |