Libraryless. Click here for Pure Java version (818L/6K/19K).
!752 static int maxQuestionLength = 150; static int maxAnswerLength = 450; answer { if "last dialogs" s = "5 last dialogs"; if "last dialog" s = "1 last dialogs"; if "* last dialogs" { int n = parseInt(m.unq(0)); L history = cast get(getMainBot(), "history"); new StringBuffer buf; int x = max(l(history)-n, 0); for (int i = l(history)-1; i >= x; i--) { O dialog = history.get(i); S q = shorten(getString(dialog, "question"), maxQuestionLength); S a = shorten(getString(dialog, "answer"), maxAnswerLength); buf.append("User: " + q + "\n"); buf.append("Eleutheria: " + a + "\n"); } ret slackSnippet(buf); } }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment