Run Python code right in your Telegram messages
Project description
Write Python code and run it right inside your Telegram messages. For example:
- Use it as an in-chat calculator.
- Search for song lyrics within a chat.
- Delete multiple messages with a command.
- Find out the most active members in a chat.
- Instantly convert TeX to Unicode in your messages: for example,
x = \alpha^7
becomesx = α⁷
.
TGPy uses Telegram API through the Telethon library.
Quick Start
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
Learn
Demo
Finding out the number of premium users in a chat
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.
Source Distribution
Built Distribution
File details
Details for the file tgpy-0.6.2.tar.gz
.
File metadata
- Download URL: tgpy-0.6.2.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/36.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6584f3ed705091d5ac957cfbee7767e53272bc7a7d8650fd973e84f7389c1a9 |
|
MD5 | 301866c47a172bbf38c83b1d35181ce1 |
|
BLAKE2b-256 | 4dc96c92c5d343005275fda92d7c841c993aa16dd05f45a0bc38d35d06ec82af |
File details
Details for the file tgpy-0.6.2-py3-none-any.whl
.
File metadata
- Download URL: tgpy-0.6.2-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/36.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 917741271c8fc403c083581c3d4cc87a3b78794da9053cab3ada6f330e8d7e3a |
|
MD5 | 5f43017d4af6b36366774a37baff5a3f |
|
BLAKE2b-256 | 05b8fd63599c76afe063a697b3720746fbaee121977378a4c4ff6987b4078aab |