Simple Telegram helper
Project description
EzTelegramAPI
The simplest way to send Telegram messages from Python.
One function. Zero boilerplate. Just send.
🔗 GitHub: https://github.com/EmptyOverlord/EzTelegramAPI
📦 PyPI: https://pypi.org/project/eztelegramapi/
Installation
pip install EzTelegramAPI
Quickstart
from eztelegramapi import send_message
TOKEN = "123456789:AABBCCDDEEFFaabbccddeeff-1234567890" # from @BotFather
CHAT_ID = 987654321 # your chat ID
send_message(TOKEN, CHAT_ID, "Hello from EzTelegramAPI! 🚀")
That's it. Seriously.
Why EzTelegramAPI?
| EzTelegramAPI | Other libraries | |
|---|---|---|
| Setup | None | Config, classes, handlers... |
| Lines to send a message | 1 | 5–20+ |
| Dependencies | requests |
Multiple |
| Learning curve | Zero | Non-zero |
API Reference
send_message(token, chat_id, text)
| Parameter | Type | Description |
|---|---|---|
token |
str |
Your bot token from @BotFather |
chat_id |
int |
Target chat or user ID |
text |
str |
Message text (supports emoji ✅) |
Returns: requests.Response — the raw Telegram API response.
Examples
Alert on error:
try:
risky_operation()
except Exception as e:
send_message(TOKEN, CHAT_ID, f"🔴 Error: {e}")
Cron job notification:
from datetime import datetime
now = datetime.now().strftime("%Y-%m-%d %H:%M")
send_message(TOKEN, CHAT_ID, f"✅ Backup finished at {now}")
Send your public IP address:
import requests
ip = requests.get("https://api.ipify.org").text
send_message(TOKEN, CHAT_ID, f"🌐 My IP: {ip}")
How to get your Chat ID
- Start a chat with @userinfobot
- Send
/start - It replies with your numeric ID — use that as
chat_id
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eztelegramapi-0.1.9.tar.gz.
File metadata
- Download URL: eztelegramapi-0.1.9.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
198bf5ad5d7367eb208aa8bece5b93b2a5519ca3e2737a62033cb11b1de644ef
|
|
| MD5 |
0387d7f205b86c1161c2258c552d85bb
|
|
| BLAKE2b-256 |
310b8fdc9e5a8eb4aaa1ac836c8aeffcfd0b7d1c6368995282893e98469b6f78
|
File details
Details for the file eztelegramapi-0.1.9-py3-none-any.whl.
File metadata
- Download URL: eztelegramapi-0.1.9-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
775df3753007cd05fb1dee6427555732ea13becc55b5d3647adec2c103e19fff
|
|
| MD5 |
3a5d05da6535051768e7f0f67d9e3cbc
|
|
| BLAKE2b-256 |
6fcbcd8b76a64a332677f73959f3e05ba3b2e40e012fb532c4cb24bdc9281590
|