Twilio Messager is a python programme that sends and receives SMS using SMS-enabled Twilio phone numbers.
Follow these steps to use this application locally.
-
Install twilio
pip install twilio
-
Install flask
pip install -U Flask
OR:
pip install -r requirements.txt
-
Go to Twilio console to get your credentials
-
Replace
YOUR_ACCOUND_SID
andYOUR_AUTH_TOKEN
inutil.py
with your own credentials
-
Go to ngrok dashboard to get your authtoken
-
Open a terminal in the directory of Ngrok excutable and type
ngrok authtoken YOUR_NGROK_AUTHTOKEN
Replace
YOUR_NGROK_AUTHTOKEN
with your own ngrok authtoken. You only need to do this once. -
Start ngrok
ngrok http 5000
You will see the ngrok console UI once it starts.
-
Add
/sms
to your ngrok HTTP forwarding URL. Then set it to the webhook address of your number(s) on Twilio consolehttp://example.ngrok.io/sms
Run the main.py
script to start the messager
python main.py
Enter phone number starting with +COUNTRY_CODE
You may lookup your country code here
Add $
to the end of a message or phone number to cancel operation
A log file Instance.csv
will be automatically if there is no such file in the programme directory. It stores messaging data in the format of Timestamp,Sender,Receiver,Message,Type
If there is already an Instance.csv
in the programme directory, new logs will be appended to the existing log file.
Distributed under the MIT License. See LICENSE.md
for more information.
Project Link: https://github.com/songyuew/twilio_messager