Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1001910 // Find unanswered questions in #talkingbots

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (866L/7K/21K).

!752

p {
  L<SlackMsg> msgs = slackReadTalkingBots(150);
  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);
  }
  /*new L<SlackMsg> qs;
  for (SlackMsg m : msgs)
    if (m.user != null)
      qs.add(m);*/
  L<SlackMsg> qs = msgs; // All remaining msgs must be user msgs.
  printList(qs);
}

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;
}

Author comment

Began life as a copy of #1001908

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

Snippet ID: #1001910
Snippet name: Find unanswered questions in #talkingbots
Eternal ID of this version: #1001910/1
Text MD5: 5d28ad4c114f892b09f5deb91c7754cc
Transpilation MD5: 11f2749682cd0fd00be29301f2eb87de
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-06 19:13:14
Source code size: 582 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 572 / 581
Referenced in: [show references]