MCPcopy Create free account
hub / github.com/annmuor/jnode / processCommands

Method processCommands

jnode-core/src/jnode/robot/ScriptFix.java:99–121  ·  view source on GitHub ↗
(FtnMessage fmsg)

Source from the content-addressed store, hash-verified

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);

Callers 1

executeMethod · 0.95

Calls 8

writeReplyMethod · 0.95
getRobotNameMethod · 0.95
helpMethod · 0.95
listMethod · 0.95
extractScriptIdMethod · 0.95
runScriptMethod · 0.95
formatMethod · 0.80
getTextMethod · 0.65

Tested by

no test coverage detected