-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
35 lines (21 loc) · 710 Bytes
/
app.py
File metadata and controls
35 lines (21 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flask import Flask, request, render_template, redirect, url_for
from twilio.twiml.messaging_response import MessagingResponse
import time
import reply
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello world"
@app.route("/sms", methods=['GET','POST'])
def sms_reply():
"""Respond to incoming calls with a simple text message."""
# Fetch the message
msg = request.form.get('Body')
#check the message by parsing text
resp = MessagingResponse()
#resp.message(reply.reply_message(msg))
resp.message(reply.reply_message(msg))
# Create reply
return str(resp)
if __name__ == '__main__':
app.run(debug=True)