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

21
LINES

< > BotCompany Repo | #1002231 // Slack im.list test (list private message channels)

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

Libraryless. Click here for Pure Java version (1110L/8K/25K).

1  
!752
2  
3  
static S token;
4  
5  
p {
6  
  token = devChannelToken();
7  
  S url = "https://slack.com/api/im.list";
8  
  Map postData = litmap("token", token);
9  
  S data = doPost(postData, url);
10  
  print(data);
11  
  Map map = jsonDecodeMap(data);
12  
  List<Map> ims = cast map.get("ims");
13  
  new L<S> names;
14  
  for (Map m : ims) {
15  
    S userID = getString(m, "user");
16  
    //print("userID = " + userID);
17  
    S userName = slackGetUserName(token, userID);
18  
    names.add(userName);
19  
  }
20  
  print("IM Users: " + join(", ", names));
21  
}

Author comment

Began life as a copy of #1002230

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: #1002231
Snippet name: Slack im.list test (list private message channels)
Eternal ID of this version: #1002231/1
Text MD5: 5bfb8af2d96439cfc2199a12bd514e8f
Transpilation MD5: 072af97cabbed5f65235c9f67fc43eec
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-30 20:14:50
Source code size: 518 bytes / 21 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 519 / 523
Referenced in: [show references]