Skip to content

Listen to channel messages using the telethon python library and alert the user using the twilio library

Notifications You must be signed in to change notification settings

Strix007/telethon-channel-twilio-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telethon-channel-twilio-alert

Listen to channel messages using the telethon python library and alert the user using the twilio library.

Table of Contents

About

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.

Requirements

Telegram API Token

Obtaining API Tokens for Telegram Account

Create a Telegram application:

  • 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.

Obtain your API credentials:

  • After creating the application, you’ll receive an api_id and api_hash. These are your credentials to access the Telegram API.

Twilio Credentials

Obtaining API Tokens for Twilio Account

Sign up or log in to Twilio:

  • 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.

Navigate to the Console:

  • Once logged in, go to the Twilio Console by clicking on the Console link at the top right corner of the page.

Access API credentials:

  • From the Twilio Console, copy the Account SID , Auth Token and My Twilio phone number. These are the credentials required for our script.

What To Install

Setup

  • 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 python run listener.py

First Run

Upon the initial execution, the script will prompt you to provide details such as your Telegram phone number, which will trigger the delivery of a one-time password (OTP). Subsequently, you’ll be asked to input credentials for both the Telegram and Twilio APIs, along with additional information like preferred keywords for inclusion/exclusion, the designated alert recipient’s number, and the accompanying message. These prompts only occur during the first run of the script; subsequent executions won’t require you to provide these details again.

Contributions

Contributions such as PRs and Issues are awlays welcome and highly encouraged.

About

Listen to channel messages using the telethon python library and alert the user using the twilio library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages