added sitterbot_starter and revamped sitter_bot.py quite a bit.

This commit is contained in:
2017-10-25 16:11:27 -04:00
parent bce2ae4eb7
commit 25b373a818
10 changed files with 396 additions and 57 deletions

22
sitterbot_starter.py Normal file
View File

@@ -0,0 +1,22 @@
import os
from flask import Flask, request
from twilio.rest import Client as TwilioClient
from twilio.twiml.messaging_response import MessagingResponse
twilio_client = TwilioClient(os.getenv('TWILIO_SID'), os.getenv('TWILIO_TOKEN'))
app = Flask(__name__)
app.config.from_object(__name__)
@app.route('/bot', methods=['POST'])
def bot():
from_ = request.values.get('From')
body = request.values.get('Body').lower()
resp = MessagingResponse()
resp.message(f'ok, you said {body}.')
return str(resp)
if __name__ == '__main__':
app.run(debug=True, port=8000)