Listen to channel messages using the telethon python library and alert the user using the twilio library.
This script utilizes the Telethon and Twilio Python libraries to monitor messages on a designated channel. When a message containing a specified keyword is detected, it triggers an SMS notification.- Go to the Telegram website and log in with your Telegram account.
- Once logged in, go to the API development tools page.
- Fill out the required fields (name, description, etc.) to create a new application.
- After creating the application, you’ll receive an
api_id
andapi_hash
. These are your credentials to access the Telegram API.
- If you don’t have a Twilio account yet, sign up for one at Twilio’s website.
- If you already have an account, log in using your credentials.
- Once logged in, go to the Twilio Console by clicking on the Console link at the top right corner of the page.
- From the Twilio Console, copy the
Account SID
,Auth Token
andMy Twilio phone number
. These are the credentials required for our script.
- Clone the script on your local machine
git clone https://github.com/Strix007/telethon-channel-twilio-alert.git
- CD into the directory
cd telethon-channel-twilio-alert
- Run Poetry
poetry install
- Run the script
poetry run python listener.py