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

18
LINES

< > TinyBrain | #1009210 - Block/Unblock IP Bot

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

Libraryless. Click here for Pure Java version (2201L/15K/48K).

!7

answer {
  if (!webAuthed()) null;
  if "block ip *" {
    call(mainBot(), "addBlockedIP", assertIPv4($1));
    ret "OK";
  }
  
  if "unblock ip *" {
    call(mainBot(), "removeBlockedIP", assertIPv4($1));
    ret "OK";
  }
  
  if "blocked ips" {
    ret structForUser(cloneList((L) get(mainBot(), "blockedIPs")));
  }
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1009210
Snippet name: Block/Unblock IP Bot
Eternal ID of this version: #1009210/2
Text MD5: 8fa6eac25878722060c0fd851a7ef543
Transpilation MD5: 20dad2d0fcb413cf86c9b75d4a554367
Author: stefan
Category: eleu
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-16 21:40:47
Source code size: 343 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 23 / 49
Version history: 1 change(s)
Referenced in: [show]