Libraryless. Click here for Pure Java version (906L/7K/22K).
!752 p { while true { L<SlackMsg> qs = getNewQuestions(); print(l(qs) + " question(s)."); printList(qs); sleepSeconds(10); } } static S getNewQuestions_lastSeen; static L<SlackMsg> getNewQuestions() { L<SlackMsg> msgs = slackReadTalkingBots(150, getNewQuestions_lastSeen); if (!msgs.isEmpty()) getNewQuestions_lastSeen = last(msgs).ts; int i = indexOfLastBotAnswer(msgs); if (i > 0) { print("Last bot answer at " + (i+1) + "/" + l(msgs) + ": " + structure(msgs.get(i))); msgs = subList(msgs, i+1); } ret msgs; } static int indexOfLastBotAnswer(L<SlackMsg> msgs) { for (int i = l(msgs)-1; i >= 0; i--) if (msgs.get(i).botName != null) ret i; ret -1; }
Began life as a copy of #1001910
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment