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

15
LINES

< > BotCompany Repo | #1025359 // React to all events Discord Bot [OK]

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

Uses 5909K of libraries. Click here for Pure Java version (13582L/73K).

1  
!7
2  
3  
import net.dv8tion.jda.core.events.Event;
4  
import net.dv8tion.jda.core.events.user.update.*;
5  
6  
cmodule ReactToEvents extends DynTalkBot2 {
7  
  void init {
8  
    super.init();
9  
    onDiscordEvent(e -> {
10  
      print("Generic Discord event: " + e);
11  
      if (e cast UserUpdateOnlineStatusEvent)
12  
        print("User " + e.getMember() + " old presence : " + e.getOldValue() + ", new presence: " + e.getNewValue());
13  
    });
14  
  }
15  
}

Author comment

Began life as a copy of #1025354

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025359
Snippet name: React to all events Discord Bot [OK]
Eternal ID of this version: #1025359/14
Text MD5: bad9b85ef025a3babc7490984db67920
Transpilation MD5: 6521e04c9bef5d9e1bfd97f07c3fff25
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-11 14:26:19
Source code size: 434 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 282 / 1543
Version history: 13 change(s)
Referenced in: [show references]