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).

1  
!752
2  
3  
p {
4  
  L<SlackMsg> msgs = slackReadTalkingBots(150);
5  
  int i = indexOfLastBotAnswer(msgs);
6  
  if (i > 0) {
7  
    print("Last bot answer at " + (i+1) + "/" + l(msgs) + ": " + structure(msgs.get(i)));
8  
    msgs = subList(msgs, i+1);
9  
  }
10  
  /*new L<SlackMsg> qs;
11  
  for (SlackMsg m : msgs)
12  
    if (m.user != null)
13  
      qs.add(m);*/
14  
  L<SlackMsg> qs = msgs; // All remaining msgs must be user msgs.
15  
  printList(qs);
16  
}
17  
18  
static int indexOfLastBotAnswer(L<SlackMsg> msgs) {
19  
  for (int i = l(msgs)-1; i >= 0; i--)
20  
    if (msgs.get(i).botName != null) ret i;
21  
  ret -1;
22  
}

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: 577 / 586
Referenced in: [show references]