Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. package at.JonasDev.main;
  2.  
  3. import com.github.theholywaffle.teamspeak3.api.TextMessageTargetMode;
  4. import com.github.theholywaffle.teamspeak3.api.event.TS3EventAdapter;
  5. import com.github.theholywaffle.teamspeak3.api.event.TS3EventType;
  6. import com.github.theholywaffle.teamspeak3.api.event.TextMessageEvent;
  7. import com.github.theholywaffle.teamspeak3.api.wrapper.Client;
  8.  
  9. public class ChatBot {
  10.  
  11. final static int clientid = Main.api.whoAmI().getId();
  12.  
  13. public static void start() {
  14.  
  15. Main.api.registerEvent(TS3EventType.TEXT_PRIVATE, 0);
  16. Main.api.addTS3Listeners(new TS3EventAdapter() {
  17.  
  18. @Override
  19. public void onTextMessage(TextMessageEvent e) {
  20. if(e.getTargetMode() == TextMessageTargetMode.CLIENT && e.getInvokerId() != clientid) {
  21. String msg = e.getMessage().toLowerCase();
  22. if(msg.startsWith("!verify")) {
  23. if(msg.contains(" ")) {
  24. Client c = Main.api.getClientByUId(e.getInvokerName());
  25. String Name = msg.split(" ")[1];
  26. if(Main.NameExist(Name)) {
  27. if(Main.getType(c.getUniqueIdentifier()) == 2) {
  28. int Rang = Main.getRang(c.getUniqueIdentifier());
  29. Main.api.addClientToServerGroup(Rang, c.getDatabaseId());
  30. Main.api.sendPrivateMessage(c.getId(), "Du bist nun Verifiziert!");
  31.  
  32. }
  33.  
  34. }
  35.  
  36. }
  37.  
  38. }
  39.  
  40. }
  41.  
  42. }
  43.  
  44. });
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement