Telegram.py
An async API wrapper for the Telegram bot API in Python
Install / Use
/learn @nthnwj/Telegram.pyREADME
telegram.py
An async API wrapper for the Telegram bot API in Python
Features
- Clean Object Oriented interface with async and await syntax
- Easy to use commands framework that integrates with with Telegram
- Modular bot structure, allowing for reloading of individual components
Installation
Python 3.10 or higher is required to install and use telegram.py.
Install the latest stable release from PyPI:
# Mac/Linux
python3 -m pip install telegram.py
# Windows
py -3 -m pip install telegram.py
Or install the development version from GitHub:
# Mac/Linux
python3 -m pip install git+https://github.com/ilovetocode2019/telegram.py
# Windows
py -3 -m pip install git+https://github.com/ilovetocode2019/telegram.py
Quick Example
import logging
import telegrampy
from telegrampy.ext import commands
logging.basicConfig(level=logging.INFO, format="(%(asctime)s) %(levelname)s %(message)s", datefmt="%m/%d/%y - %H:%M:%S %Z")
logger = logging.getLogger("telegrampy")
bot = commands.Bot("token here")
@bot.command()
async def hi(ctx):
await ctx.send("Hello")
bot.run()
For a line-by-line walkthrough for this example, see the quickstart.
Important Links
Related Skills
gh-issues
341.8kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
341.8kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
tmux
341.8kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
