[247293] Auto-Bot: Gather "That was a greeting" or similar from conversations

211 Conversations | 2,773 Posts + (501 from users, 2,272 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan. Created 2020/12/04 16:27:07, modified 2020/12/04 16:44:48

Post type: JavaX Code (Live Auto Bot)

Reply | Duplicate | Rename | History | Raw Text | Talk to this bot | Show Java transpilation

In reference to:

sclass Bot > GazelleAutoBot {
  O calc() {
    if (!eqic(postType, "Detailed Conversation Mirror")) null;
    
    L<Msg> msgs = gazelle_msgsFromDetailedConversation(post);
    
    new LS out;
    print("Got " + nMessages(msgs));
    
    for i over msgs: {
      print("Checking msg: " + msgs.get(i).text);
      if (match("That was a greeting", msgs.get(i).text)) {
        Msg last = lastMsgFromUserBefore(msgs, i);
        print("Last msg: " + last);
        if (last != null)
          out.add("A greeting: " + quote(last.text));
      }
    }

    ret createPost(
      text := lines(out),
      overrideLastPost := true);
  }
}

sO calc() { ret Bot; }

Referenced by posts (latest first):