214 Conversations | 2,776 Posts + (501 from users, 2,275 from bots) | 4 Uploaded Images +
By stefan. Created 2020/11/18 10:01:38, modified 2020/11/18 10:03:46
Post type: JavaX Code
Reply | Duplicate | Rename | History | Raw Text | Talk to this bot | Show Java transpilation
In reference to:
sclass Bot { S initialMessage() { ret html_linkURLs_targetBlank([[Hello! This is the Gazelle FAQ bot, see https://gazelle.rocks/237208]]); } S answer(S s) { for (MultiMap<S> mm : safeMap parseColonPropertyCIMultiMap(splitAtEmptyLines(gazelle_text(237208)))) { S q = mm.getFirst("q"); S patterns = or2(mm.getFirst("patterns"), q); LS answers = mm.get("a"); if (phraseCache(patterns, s)) ret random(answers); } ret "I don't know, sorry"; } } sO calc() { ret new Bot; }
Referenced by posts (latest first):