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

17
LINES

< > BotCompany Repo | #1022188 // gazelle_monologues

JavaX fragment (include)

1  
static LL<GazelleLine> gazelle_monologues(O... _) {
2  
  int minLength = optPar minLength(_, 2);
3  
  int maxDelay = optPar maxDelay(_, 5000);
4  
  new LL<GazelleLine> out;
5  
  for (long channelID : dm_discord_allChannelIDs()) {
6  
    L<GazelleLine> l = dm_discord_linesInChannel(channelID);
7  
    for i over l: {
8  
      int j = i+1;
9  
      if (!l.get(i).bot) continue;
10  
      while (j < l(l) && l.get(j).bot && l.get(j).timestamp <= l.get(j-1).timestamp+maxDelay) ++j;
11  
      if (j-i >= minLength)
12  
        out.add(cloneSubList(l, i, j));
13  
      i = j-1;
14  
    }
15  
  }
16  
  ret out;
17  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1022188
Snippet name: gazelle_monologues
Eternal ID of this version: #1022188/10
Text MD5: 3de03f56cec8066e27dafb6c9d934cf6
Author: stefan
Category: javax / gazelle
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-10 15:14:00
Source code size: 573 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 333 / 365
Version history: 9 change(s)
Referenced in: [show references]