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

24
LINES

< > BotCompany Repo | #1002277 // Tagging Compo Test (depends on getBot)

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

Transpiled version (971L) is out of date.

1  
!752
2  
3  
static class SlackMsg {
4  
  S user, botName; // one of these is going to be set
5  
  S userName; // looked up if user != null
6  
  S type, text, ts;
7  
  O reactions;
8  
  S channelID;
9  
}
10  
11  
p {
12  
  // probably one should be synchronizing these structures
13  
  // (why are PersistentLog and PersistentMap not synchronized)?
14  
  Map tagsByTS = cast getFromOtherBot("#1002192", "tagsByTS");
15  
  L log = cast callOtherBot("#1002185", "getLog", "talkingbots");
16  
  
17  
  print("Scanning " + l(log) + " items.");
18  
  
19  
  for (int i = 0; i < l(log); i++) {
20  
    SlackMsg msg = cast restructure(log.get(i)); // restructure == import into our namespace
21  
    O tag = tagsByTS.get(msg.ts);
22  
    print("Tag found: " + structure(tag));
23  
  }
24  
}

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: #1002277
Snippet name: Tagging Compo Test (depends on getBot)
Eternal ID of this version: #1002277/1
Text MD5: b708f1cc1be313a97c8fa54470cfc82b
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-24 20:23:05
Source code size: 721 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 670 / 653
Referenced in: [show references]