Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.76 KB

Readme.md

File metadata and controls

56 lines (39 loc) · 1.76 KB

Telegram Message to SMS (Alert)

This script will send sms message to your phone when a message from a selected chat is sent using Yegara Free SMS API Gateway

to change the sms gateway to your preferred gateway you have to change the sendSMS function in general.ts file under the src/utils folder

Installation

Use the package manager npm to install the required packages.

npm install

Important

If you don't what to login each time time you run the script copy the session string you see on your terminal after you login in for the first time and paste it to the SessionString object as the example below.

console.log(client.session.save()) // copy the output of this

// paste the output in the StringSession below
const session = new StringSession("PASTE_THE_COPIED_SESSION_STRING_HERE");

.env

PORT="3000"
ALERT_COMMAND="addalert"
SMS_GATEWAY="https://sms.yegara.com/api"
SMS_TOKEN="YEGARA_SMS_TOKEN"
PHONE_NUMBER="0912345678"
DATABASE_URL="postgresql://m2:randompassword@localhost:5432/telegram_notifier?schema=public"

Usage

You have to use the commands in the chat you want to add to your alert list in a private message or group the command will be deleted automatically if successful plus you will receive a success message in saved message

Commands

/addalert
/stopalert


/addalert TRIGGER_TEXT

if TRIGGER_TEXT is not provided the message will be triggered by any message sent from the chat

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Developer

Mikiyas Lemlemu