Simple Telegram helper
Project description
EzTelegramApi
The simplest way to send Telegram messages from Python.
One function. Zero boilerplate. Just send.
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 Python! 🚀")
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
eztelegramapi-0.1.7.tar.gz
(2.3 kB
view details)
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.7.tar.gz.
File metadata
- Download URL: eztelegramapi-0.1.7.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9659df1e6fe67dff910ab75ef3d8125f804ed7368e63e0d3f1ce645aa40f7673
|
|
| MD5 |
2e2cc599f0773409e58672d302a2f02f
|
|
| BLAKE2b-256 |
f2dfd1a00093959a9f68ab53a96d010c38dff00b54ad51282266e68067e8e55d
|
File details
Details for the file eztelegramapi-0.1.7-py3-none-any.whl.
File metadata
- Download URL: eztelegramapi-0.1.7-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b23f70187f217d7ad561b52af4bc9e28440e6a19c7e786a2404439403a9ff27
|
|
| MD5 |
a1c366fc7133ff97c2f82e7652e52037
|
|
| BLAKE2b-256 |
c5c055958b2dbea9a3a992d0148cbef1e47ba3f6e005b83d1ef90a092a93d762
|