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

16
LINES

< > BotCompany Repo | #1002573 // Distinct Users Bot (dev.)

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

Libraryless. Click here for Pure Java version (830L/6K/19K).

!752

answer {
  if "which users have you had" {
    L history = cast get(getMainBot(), "history");
    new TreeSet<S> users;
    
    for (O dialog : history) {
      S user = getString(dialog, "user");
      if (user != null)
        users.add(user);
    }
    
    ret structure(list(users));
  }
}

Author comment

Began life as a copy of #1002468

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: #1002573
Snippet name: Distinct Users Bot (dev.)
Eternal ID of this version: #1002573/1
Text MD5: 866a1d1c8c4d52d799bf95e74b6be054
Transpilation MD5: ec8613003c12eed8db6eaea89629b12e
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-02 17:32:17
Source code size: 316 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 666 / 1157
Referenced in: [show references]