Skip to content

Create a Telegram bot using scratch.mit.edu (proof of concept)

License

Notifications You must be signed in to change notification settings

DavideGalilei/scratch-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code style: black

Scratch Telegram Bot

Create a Telegram bot using scratch.mit.edu (proof of concept)

⚠️ Be careful when using eval block, since you're executing Python code on YOUR MACHINE.

Requirements

  • Python 3.6 or higher
  • Requestly browser extension

How to use

  • $ python -m pip install -r requirements.txt
  • Open Requestly settings
  • Add a "Replace Host" rule
  • Replace https://translate-service.scratch.mit.edu/ with http://localhost:5000/ and save rule settings
  • Replace api_id, api_hash (you can obtain those on https://my.telegram.org/apps), bot_token (Obtain it from BotFather) parameters in Client instance in main.py
  • $ python main.py
  • Open https://scratch.mit.edu/projects/504626732 or create your own project uploading Scratch Telegram Bot.sb3 on Scratch.
  • Run the project and send /start to your Telegram bot

Credits

Thanks to ShishCat for telling me how to MITM Scratch's translator plugin, Dan for his amazing library (Pyrogram).

About

Create a Telegram bot using scratch.mit.edu (proof of concept)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages