|
@@ -126,21 +126,9 @@ public class SimpleShell {
|
126
|
126
|
}
|
127
|
127
|
|
128
|
128
|
if (list.contains("send")) {
|
129
|
|
- Message message;
|
130
|
|
- String sentence = "";
|
131
|
|
- for (int i = 2; i < list.size(); i++) {
|
132
|
|
- sentence += list.get(i) + " ";
|
133
|
|
- }
|
134
|
|
- sentence = sentence.substring(0, sentence.length()-1);
|
135
|
|
- if (list.get(1).equalsIgnoreCase("group")){
|
136
|
|
- message = new Message(user.getGithub(), "", sentence);
|
137
|
|
- } else {
|
138
|
|
- message = new Message(user.getGithub(), list.get(1), sentence);
|
139
|
|
- }
|
140
|
|
- String results;
|
141
|
|
- Thread thread = new Thread(results = webber.send_message(message));
|
|
129
|
+ MessageSender sender = new MessageSender(list, user, webber);
|
|
130
|
+ Thread thread = new Thread(sender);
|
142
|
131
|
thread.run();
|
143
|
|
- SimpleShell.prettyPrintMessage(results);
|
144
|
132
|
continue;
|
145
|
133
|
}
|
146
|
134
|
|