(FtnMessage fmsg)
| 97 | } |
| 98 | |
| 99 | private void processCommands(FtnMessage fmsg) throws SQLException { |
| 100 | for (String line : fmsg.getText().split("\n")) { |
| 101 | line = line.toLowerCase(); |
| 102 | |
| 103 | if (HELP.matcher(line).matches()) { |
| 104 | FtnTools.writeReply(fmsg, |
| 105 | MessageFormat.format("{0} help", getRobotName()), |
| 106 | help()); |
| 107 | } else if (LIST.matcher(line).matches()) { |
| 108 | FtnTools.writeReply(fmsg, |
| 109 | MessageFormat.format("{0} list", getRobotName()), |
| 110 | list()); |
| 111 | } else { |
| 112 | Long id = extractScriptId(line); |
| 113 | if (id != null) { |
| 114 | FtnTools.writeReply(fmsg, MessageFormat.format( |
| 115 | "{0} run script {1}", getRobotName(), id), |
| 116 | runScript(id)); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | static Long extractScriptId(String line){ |
| 124 | Matcher m = RUN.matcher(line); |
no test coverage detected