[228146] Get all user inputs from conversations

215 Conversations | 2,785 Posts + (501 from users, 2,284 from bots) | 4 Uploaded Images +

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

By stefan. Created 2020/11/12 11:18:21, modified 2020/11/12 11:19:33

Post type: JavaX Code

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

In reference to:

hijackPrint(r {
  L<GazellePost> convos = safeFilter(getAllPosts(), p -> eqic(p.type, "Conversation Mirror"));

  for (GazellePost p : convos) {
    S botID = regexpFirstGroup("Bot: Bot (\\d+) ready", p.text);
    for (S userLine : startingWithIC_dropPrefix("User: ", tlft(p.text))) {
      print("User said to bot " + botID + ": " + userLine);
      
      // Do some stuff with userLine and botID here
    }
  }
})

Referenced by posts (latest first):