Skip to main content

Simple Telegram helper

Project description

EzTelegramAPI

Python versions|234

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

  1. Start a chat with @userinfobot
  2. Send /start
  3. It replies with your numeric ID — use that as chat_id

License

MIT

Project details


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.9.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eztelegramapi-0.1.9-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for eztelegramapi-0.1.9.tar.gz
Algorithm Hash digest
SHA256 198bf5ad5d7367eb208aa8bece5b93b2a5519ca3e2737a62033cb11b1de644ef
MD5 0387d7f205b86c1161c2258c552d85bb
BLAKE2b-256 310b8fdc9e5a8eb4aaa1ac836c8aeffcfd0b7d1c6368995282893e98469b6f78

See more details on using hashes here.

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

Hashes for eztelegramapi-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 775df3753007cd05fb1dee6427555732ea13becc55b5d3647adec2c103e19fff
MD5 3a5d05da6535051768e7f0f67d9e3cbc
BLAKE2b-256 6fcbcd8b76a64a332677f73959f3e05ba3b2e40e012fb532c4cb24bdc9281590

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page