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

24
LINES

< > BotCompany Repo | #1002016 // Slack Auto-Invite (works)

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

Libraryless. Click here for Pure Java version (684L/5K/17K).

1  
!752
2  
3  
p {
4  
  S slackInviteUrl = "https://nlbots.slack.com/api/users.admin.invite?t=" + now()/1000; // PHP time()
5  
  S token = loadSecretTextFileMandatory("#1001925", "nlbots-slack-token").trim();
6  
  
7  
  S email = "info@superinformatiker.de";
8  
  S autoJoinChannels = "C0FHTG6SY,C0FHTG6UC";
9  
10  
  // echo date('c').' - '.$i.' - '."\"".$user['name']."\" <".$user['email']."> - Inviting to ".$slackHostName." Slack\n";
11  
12  
  Map fields = litmap(
13  
    "email", email,
14  
    "channels", autoJoinChannels,
15  
    "first_name", "",
16  
    "token", token,
17  
    "set_active", "true",
18  
    "_attempts", "1"
19  
  );
20  
21  
  S data = doPost(fields, slackInviteUrl);
22  
  print(data); // it's just "ok = true"
23  
24  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002016
Snippet name: Slack Auto-Invite (works)
Eternal ID of this version: #1002016/1
Text MD5: 5c639f22f3b9edbd957ce7807ffb02b9
Transpilation MD5: 0a3838c33eb62d4a4c8a171c1fefa401
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-13 21:11:44
Source code size: 688 bytes / 24 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 590 / 609
Referenced in: [show references]