and spy on Telegram channelsper accountDetails are logged to a MySQL database, a private Google Sheet and your own private channel for analysis.
This is a functioning proof-of-concept project with known bugs. Feel free to fork, share and drop me a line.
Potential Business Applications********************** Sock puppeteering to overthrow a despotic regime
Write all notifications to private Google Sheet
Supports regular expressions for keyword filtering
SQLAlchemy for agnostic data persistence

Logging contextual message and channel data to a private channel and database
Stores meta information about sender of message, channel, number of participants in the channel

Persists session of channels joined
Login once, bot stays logged in forever without needing 2FA re-authentication
Join up to channels per account
You first will need to create Telegram API credentials by providing a phone number here: (https://my.telegram.org/auth
)
Validate with Burner. You will be sent an authcode via SMS, you will need to provide
(******************************************************************
Log into Telegram
Attempt to login with the app by running
python3 bot.py (************************************************)
Sessions are saved in the (session /) ************************************************ (folder as) ************************************************ (session)
Scaling Telegram accounts
Figuring out how to scale accounts was a bit of a nightmare as I needed an automated process. Telegram requires you use a real phone number that can recieve texts from a shortcode.
Unfortunately services with APIs like Twilio are prohibited from receiving SMS from shortcodes in the US, Canada and UKhttps://support.twilio.com/hc/en-us/articles/ – Can-Twilio-numbers-receive-SMS-from-a-short-code-for fraud purposes. This would’ve been ideal, bahumbug.
A whole evening was wasted on this endeavor until I remembered a great app I used in the past: Burner (https://www.burnerapp.com/
– which coincidentally does have an API (https://docs.telethon.dev/en/latest/)
). Meaning you can dynamically generate numbers, instantiate a new account and authenticate it all via Telegram’s client SDK in Python (Telethon:The best part is Burner numbers are free for 14 days. Telegram accounts connected via client API need only login once and permanently persist sessions. I have not integrated with the Burner API, but the process is straight forward.
(**************************************************************************
Telethon SDK SDK)The bot is built on top of the Telethon Python SDK ( https: / /docs.telethon.dev/en/latest/
)
A few things to note and gotchas encountered in building this proof of concept:
Create a Docker repository, instructions here: https://docs.docker.com/docker-hub/repos/
Build the Docker image. We’re running on a lean Alpine Python 3.7 image.
docker build -t (/
NOTE:You will want an entry point to run bot.py and provide it a Telegram API user ID. There are a few ways to approach this:
You can comment out and include the CMD instruction and provide the API user ID via environment variable:
CMD [“python”,”bot.py”,”${SHILLOMATIC_ACCOUNT_ID}”]You will need to set the environment variableSHILLOMATIC_ACCOUNT_IDto your Telegram accounts API user ID inside your Cloud Provider’s console or export it in your shell environment withexport SHILLOMATIC_ACCOUNT_ID=“ (************************************************
Or you can set or over-ride the entry point in your cloud provider just make sure you provide the Telegram API user ID as an argument:
Or you can run the bot inside the shell environment with Docker:
SSH into your remote shell environment
Pull the Docker image from the remote repository:
docker pull/ / informer: latest
GIPHY App Key not set. Please check settings