!752
static Class mainBot;
p {
startBot("Snippet Text Bot", "#1002084");
}
static S html() {
ret "
These are the commands of which I know that I know them:
" + htmlTable(allQuestions());
}
static L allQuestions() {
L botIDs = cast get(mainBot, "botIDs");
new Set set;
for (S botID : botIDs) pcall {
S src = loadSnippetThroughBot(botID);
set.addAll(getSupportedQuestions(src));
}
ret list(set);
}
static S loadSnippetThroughBot(S snippetID) {
S answer = sendToLocalBot("Snippet Text Bot", "what is the text of snippet *", snippetID);
new Matches m;
assertTrue(match("the text of snippet * is *", answer, m));
ret m.unq(1);
}