Skip to content

c0x6a/pyrun-userbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyRun Userbot

Userbot for telegram than runs Python code, made with Telethon.

It uses Python3.7 to work.

Installation:

pip install -U -r requirements.txt

You will also need to have imagemagick installed in your O.S.

If you get:

pygments.formatters.img.FontNotFound: No usable fonts named: "Bitstream Vera Sans Mono"

You will need to add that font to your O.S. too.

Usage:

Run it with:

python bot/userbot.py

When you have your userbot running, simply send python code in a message using the command !!py, for example:

!!py
print("Hello world")

and it would reply to your message with the result of running the code.

imgs/pytxt.png

You can send the img parameter to the command if you want to have a nice syntax highlighted image of the code, example:

!!py img
print("Hello world")

and you will get:

imgs/pyimg.png

Warning:

The bot creates a raw code.py file with the code you send to it in your message, and runs it invoking the Python interpreter, so be careful with the code you send, don't wipe your system!

ToDo:

  • Use pygments inside the code to avoid calling it with subprocess.

About

Userbot for telegram that runs Python code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages