3 var void MX_Handle(int buf, string ancestor)
5 string type = json_get(buf, strcat(ancestor, ".type"));
8 string arr = strcat(ancestor, ".content.user_ids");
9 for (int i = 0, n = stof(json_get(buf, sprintf("%s.length", arr))); i < n; ++i) {
10 string s = json_get(buf, sprintf("%s.%d", arr, i));
11 print("\{1}", s, " is typing...\n");
15 case "m.room.message": {
16 string msgtype = json_get(buf, strcat(ancestor, ".content.msgtype"));
19 string sender = json_get(buf, strcat(ancestor, ".sender"));
20 string body = json_get(buf, strcat(ancestor, ".content.body"));
21 if (body) print("\{1}", sender, ": ", body, "\n");