Run Python code right in your Telegram messages
Project description
TGPy
Run Python code right in your Telegram messages
TGPy is a tool for running Python expressions and Telegram API scripts, built on top of Telethon.
- Do Python calculations in dialogs
- Use code to send messages, save files, analyze chats and more
- Set up functions to automate your Telegram actions
Getting started
Python 3.9+ required. Install TGPy and connect it to your Telegram account:
> pip install tgpy
> tgpy
You’re ready now. Send Python code to any chat, and it will run. Change your message to change the result.
Details on installation: http://tgpy.tmat.me/installation/
New TGPy docs
Basics Guide: All you need to know to start using TGPy.
Extensibility Guide: Special features for advanced usage.
Reference: List of TGPy objects and settings.
Inspiration
TGPy is inspired by FTG and similar userbots. However, the key concept is different: TGPy is totally based on usage of code in Telegram rather than plugging extra modules. This leads both to convenience of single-use scripts and reusage flexibility.
Credits
TGPy is built on Telethon, which allows to integrate Telegram features in Python code.
Basic code transformation (such as auto-return of values) is based on meval.
License
This project is licensed under the terms of the MIT license.
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.