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

18
LINES

< > BotCompany Repo | #1002890 // Store All Bot (save Slack input as theories)

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

Libraryless. Click here for Pure Java version (1040L/7K/23K).

!752

answer {
  if "channel name"
    ret structure(getChannelName());
    
  if (eq(getChannelName(), "devchannel, #talkingbots")) {
    S ts = getSlackTS();
    int i = ts.indexOf('.');
    if (i >= 0) ts = substring(ts, i+1); // shorter slack timestamp
    S theoryName = "tb." + getUserName() + "." + ts;
    addTheory(theoryName, s);
  }
}

static void addTheory(S name, S text) {
  print("addTheory => " + callOpt(getBot("#1002762"), "saveTheory", name, text, true));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002890
Snippet name: Store All Bot (save Slack input as theories)
Eternal ID of this version: #1002890/1
Text MD5: 17bb4809cd95f52acb57942b633d4dbc
Transpilation MD5: 7ec3f556dd93c064a311b19242c803c2
Author: stefan
Category: eleu / nl
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-25 20:59:22
Source code size: 493 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 580 / 664
Referenced in: [show references]