I appreciate the support here, first! :-D
Alright so I got my texting exchange working--I'm working on building a basic from-scratch chat bot to handle responses to our outbound marketing campaigns. But this thing will need to handle multiple conversations at once. Before I get hip-deep in coding something that doesn't work, I wanted to run it by you guys.
My first thought is to build the "bot" (really just a set of if-then rules) as a class, and then have each conversation exist as an instance. So when a text comes in, step 1 is to scan through the list of existing instances--if there's already a conversation, route the message into that instance. If not, create a new instance identified as the incoming phone number. After two hours without response, the instance times out and another incoming text starts the conversation over.
I'm kind of a noob and not terribly familiar with classes. My questions:
-
Will the instances persist over time within the existing code? Or will I need to create / write to a file to store them over that amount of time?
-
Is there a better way to handle this?
You might ask why not just use an existing free chat service like Snatchbot. 1) I don't have as much freedom there as in free-styling some python, 2) I would still need software somewhere to make the end-user experience an effortless text conversation, and 3) this is an excellent opportunity to build my coding skills.
Thanks in advance for the pointers!!