// Nested Conditionals How Are You Doing Bot // Asks how you are doing and then replys based on the response using System; namespace ChatBot { class NestedConditionalsHowAreYouDoingBot : BasicBot { public override string HandleMessage(string message, string user) { if (state != "0") { state = "0"; if (User.RegexMatch("well|great|good", message)) { return "Glad to hear it!"; } else if (User.RegexMatch("ok", message)) { return "Well, at least you're not doing badly."; } else { return "Oh, I'm sorry to hear that."; } } state = "1"; return "How are you doing?"; } } }