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

20
LINES

< > BotCompany Repo | #1023420 // Discord Bot Connector - connect all loaded DynAttractorBots to Discord module

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4285L/21K).

1  
!7
2  
3  
cmodule AndroidCatBot > DynPrintLogAndEnabled {
4  
  start {
5  
    dm_vmBus_onMessage_q incomingDiscordMessage(voidfunc(Map map) {
6  
      if (!enabled) ret;
7  
      S input = getString content(map);
8  
      if (isTrue(map.get('fromBot))) ret;
9  
      if (empty(input)) ret;
10  
      O module = map.get('module);
11  
      long channelID = getLong channelID(map);
12  
      print("Have " + n2(dm_attractorBotModules(), "bot module"));
13  
      print("> " + input);
14  
      dm_sendToAllAttractorBots(input, voidfunc(S s) {
15  
        print("< " + s);
16  
        dm_call(module, 'postInChannel, channelID, s);
17  
      });
18  
    });
19  
  }
20  
}

Author comment

Began life as a copy of #1023294

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023420
Snippet name: Discord Bot Connector - connect all loaded DynAttractorBots to Discord module
Eternal ID of this version: #1023420/4
Text MD5: af59fb661fd058d3fa7671c012d2f0a5
Transpilation MD5: 4f0453ac048c7a2f85f73fd0dcfd4dde
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-18 17:03:49
Source code size: 619 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 266 / 843
Version history: 3 change(s)
Referenced in: [show references]