!752 static new MultiMap map; static class Line { S text; S timestamp; Line(){ } *(S *text, S *timestamp) {} } p{ makeBot("Store messages bot"); load("map"); } synchronized answer{ S username = ""; if(getUserName() == null){ username = "anonymous"; }else{ username = getUserName(); } if(matchStart("list all messages from *", s, m)){ ret structure(map.get(m.unq(0))); } if(match("list all users", s)){ ret structure(map.keySet()); } if(matchStart("did * say something about *", s, m)){ if(map.containsKey(m.unq(0))){ List list = map.get(m.unq(0)); int times = 0; L lolist = new L; for (int i = l(list)-1; i >= 0; i--) { if(list.get(i).text.contains(m.unq(1))){ times = times + 1; lolist.add(list.get(i).text); } } if (times == 0){ ret "no results found"; }else{ ret lolist + "\n" + times +" results found"; } }else{ ret m.unq(0) + " did not say anything."; } } Line line = new Line(s,getSlackTS()); map.put(username, line); save("map"); }