package hello;

/**
 * Class that determines what to do with a message
 * @author Zach Panzarino
 * @version 1.0.0
 */
public class Text {
    private String number, text;
    /**
     * Creates a new text and stores the text
     * @param num Sending phone number
     * @param content The content of the message
     */
    public Text(String num, String content){
        number = num;
        text = content;
    }
    /**
     * Determines what to do with a message
     * @return Whether the message was successfully executed
     */
    public String execute(){
        if (text!=null && number!=null){
            Action action;
            if (text.startsWith("/")){
                int space = text.indexOf(" ");
                if (space != 1){
                    String command = text.substring(1, space);
                    String content = text.substring(space+1);
                    action = new Action(number, content);
                    if (command.equals("create")){
                        return action.create();
                    }
                    if (command.equals("join")){
                        return action.join();
                    }
                    if (command.equals("leave")){
                        return action.leave();
                    }
                }
            }
            action = new Action(number, text);
            return action.message();
        }
        return null;
    }
}
@@ -665,24 +665,192 @@
 With(%22/%22))%7B%0A
+                if (text.startsWith(%22/leave%22))%7B%0A                    action = new Action(number, %22/leave%22);%0A                    return action.leave();%0A                %7D%0A
             
@@ -1342,127 +1342,8 @@
   %7D%0A
-                    if (command.equals(%22leave%22))%7B%0A                        return action.leave();%0A                    %7D%0A
     

Fix leave error