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).

!752

p {
  S slackInviteUrl = "https://nlbots.slack.com/api/users.admin.invite?t=" + now()/1000; // PHP time()
  S token = loadSecretTextFileMandatory("#1001925", "nlbots-slack-token").trim();
  
  S email = "info@superinformatiker.de";
  S autoJoinChannels = "C0FHTG6SY,C0FHTG6UC";

  // echo date('c').' - '.$i.' - '."\"".$user['name']."\" <".$user['email']."> - Inviting to ".$slackHostName." Slack\n";

  Map fields = litmap(
    "email", email,
    "channels", autoJoinChannels,
    "first_name", "",
    "token", token,
    "set_active", "true",
    "_attempts", "1"
  );

  S data = doPost(fields, slackInviteUrl);
  print(data); // it's just "ok = true"

}

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: 494 / 473
Referenced in: [show references]

Formerly at http://tinybrain.de/1002016 & http://1002016.tinybrain.de