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

21
LINES

< > BotCompany Repo | #1002232 // List IM Users Bot

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

Libraryless. Click here for Pure Java version (1228L/9K/27K).

!752

answer {
  if match "list your im channels" {
    S token = devChannelToken();
    S url = "https://slack.com/api/im.list";
    Map postData = litmap("token", token);
    S data = doPost(postData, url);
    print(data);
    Map map = jsonDecodeMap(data);
    List<Map> ims = cast map.get("ims");
    new L<S> names;
    for (Map _m : ims) {
      S userID = getString(_m, "user");
      //print("userID = " + userID);
      S userName = slackGetUserName(token, userID);
      names.add(userName);
    }
    ret "I have IM channels with: " + join(", ", names);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002232
Snippet name: List IM Users Bot
Eternal ID of this version: #1002232/1
Text MD5: 60638274ec00e1d553d066a4c97b1925
Transpilation MD5: beac23224be244652e71d0017dbfd3cc
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-30 20:17:52
Source code size: 591 bytes / 21 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 546 / 1478
Referenced in: [show references]