mirror of
https://github.com/nikdoof/smsbot.git
synced 2025-12-13 01:52:16 +00:00
Fix message formatting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#  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
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user