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: 621 / 1571
Referenced in: #3000169 - Answer for stefanreich
#3000174 - Answer for stefanreich
#3000175 - Answer for stefanreich
#3000176 - Answer for stefanreich
#3000177 - Answer for stefanreich
#3000179 - Answer for stefanreich
#3000180 - Answer for stefanreich
#3000181 - Answer for stefanreich
#3000182 - Answer for stefanreich
#3000184 - Answer for stefanreich
#3000185 - Answer for stefanreich
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000203 - Answer for stefanreich (>> timing hello bot)
#3000208 - Answer for bgrgndz (>> list sub bots)
#3000209 - Answer for bgrgndz (>> list sub bots)
#3000238 - Answer for stefanreich (>> t power bot)
#3000369 - Answer for Stefan (>> list sub bots)
#3000376 - Answer for stefanreich (>> list sub bots)
#3000377 - Answer for stefanreich (>> timing eleu?)
#3000380 - Answer for stefanreich (>> list sub bots)
#3000381 - Answer for speedforce (>> list sub bots)
#3000382 - Answer for ferdie (>> t = 1, f = 0)