some linting, a little var renaming

This commit is contained in:
2019-08-20 15:13:22 +02:00
parent 0908ce057f
commit 548a74cd0d
7 changed files with 700 additions and 28 deletions

View File

@@ -4,19 +4,19 @@ 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'))
twilio_client = TwilioClient(os.getenv("TWILIO_SID"), os.getenv("TWILIO_TOKEN"))
app = Flask(__name__)
app.config.from_object(__name__)
@app.route('/bot', methods=['POST'])
@app.route("/bot", methods=["POST"])
def bot():
from_ = request.values.get('From')
body = request.values.get('Body').lower()
body = request.values.get("Body").lower()
resp = MessagingResponse()
resp.message(f'ok, you said {body}.')
resp.message(f"ok, you said {body}.")
return str(resp)
if __name__ == '__main__':
app.run(debug=True, port=8000)
if __name__ == "__main__":
app.run(debug=True, port=8000)