Fix message formatting

This commit is contained in:
Five Boroughs
2019-12-17 09:24:28 +01:00
parent 9e96ac1325
commit eafd18dc21
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# ![Logo](/static/Twilio2Telegram_logo.png) Twilio2Telegram
Forward SMS and Calls from your Twilio number to Telegram
Forward Texts and Calls from your Twilio number to Telegram
## Installation
@@ -32,4 +32,4 @@ And add the domain or ip of the server hosting Twilio2Telgram, `/call` for calls
Optional :
Twilio2Telegram listens for webhook calls on the 8080 port.
If you want to add https and user the port 80, set up a reverse proxy on the machine
If you want to add https and use the port 80, set up a reverse proxy on the machine

View File

@@ -12,7 +12,7 @@ except ImportError as err:
# FB - Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
webhook_listener = Flask(__name__)
@@ -99,7 +99,7 @@ def recv_message():
"""Upon reception of a SMS."""
logger.info(' "/message" reached, IP: %s', request.remote_addr)
# FB - Format telegram Message
telegram_message = 'Text from `+{From}` ({Country}, {State}) :``` {Body}```'.format(
telegram_message = 'Text from `{From}` ({Country}, {State}) :``` {Body}```'.format(
From=request.values.get('From', 'unknown'),
Country=request.values.get('FromCountry', 'unknown'),
State=request.values.get('FromState', 'unknown'),
@@ -122,7 +122,7 @@ def recv_call():
"""Upon reception of a call."""
logger.info(' "/call" reached, IP: %s', request.remote_addr)
# FB - Format telegram Message
telegram_message = 'Call from `+{From}` ({Country}, {State}) :``` {Status}```'.format(
telegram_message = 'Call from `{From}` ({Country}, {State}) :``` {Status}```'.format(
From=request.values.get('From', 'unknown'),
Country=request.values.get('FromCountry', 'unknown'),
State=request.values.get('FromState', 'unknown'),