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

18
LINES

< > BotCompany Repo | #1002121 // Get member counts of all channels (relp.slack.com)

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

Libraryless. Click here for Pure Java version (920L/7K/22K).

!752

static S token;

p {
  token = loadSecretTextFileMandatory("#1001889", "relp-slack-botstuff-token").trim();
  S url = "https://slack.com/api/channels.list";
  Map postData = litmap("token", token);
  S data = doPost(postData, url);
  print(data);
  Map map = jsonDecodeMap(data);
  L<Map> channels = cast map.get("channels");
  for (Map c : channels) {
    S name = getString(c, "name");
    L members = cast c.get("members");
    print("Channel " + name + " members: " + l(members));
  }
}

Author comment

Began life as a copy of #1002120

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: #1002121
Snippet name: Get member counts of all channels (relp.slack.com)
Eternal ID of this version: #1002121/1
Text MD5: 59ae0c4b4d4f7e6f25c20a45064f676e
Transpilation MD5: 9ec5ed0307e9eae2855909c750123195
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-19 19:24:18
Source code size: 515 bytes / 18 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 617 / 704
Referenced in: #1002170 - slackGetChannelIDs
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)