I have managed to get the Twilio example code for responding to an sms working.
Before I spend hours trying to figure out how to do it, is it possible to have different responses depending the incoming text message?
For example:
if request.form['Body'].lower == 'hi':
resp.message('Hello')
elif request.form['Body'].lower == 'bye' or 'goodbye':
rep.message('See you later!')
else:
resp.message('What?')
Twilio developer evangelist here.
Yes absolutely! This is the entire point of Programmable SMS you get to control the response based on the incoming text, the time of day, what's in your database, or anything at all!
As Alex pointed out, you are missing an "s" in your second response in your example code. So if you tried something and it wasn't working, that's maybe why.
If you're looking to build out something conversational with SMS you may want to check out Twilio Autopilot too. It allows you to build bots with natural language understanding, which is more powerful than just checking for equality in the message body.