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

17
LINES

< > BotCompany Repo | #1003091 // simpleChatPost

JavaX fragment (include)

1  
static S simpleChatPost(S user, S text) {
2  
  O chat = simpleChatBot();
3  
  if (chat == null)
4  
    ret loadPage("http://ai1.lol/" + simpleChatID() + "/raw?robo=1&user=" + urlencode(user) + "&text=" + urlencode(text));
5  
  else
6  
    ret (S) call(chat, "postForeign", mc(), programID(), user, text);
7  
}
8  
9  
static S simpleChatPost(S text) {
10  
  L<S> names = cast get(mc(), "simpleChatPresence_names");
11  
  S name;
12  
  if (l(names) == 1)
13  
    name = first(names);
14  
  else
15  
    name = programID();
16  
  ret simpleChatPost(name, text);
17  
}

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: #1003091
Snippet name: simpleChatPost
Eternal ID of this version: #1003091/1
Text MD5: 5720dadcbeb718e0b5f300254cff3c48
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-06-06 00:50:14
Source code size: 524 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 607 / 591
Referenced in: [show references]