Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package at.JonasDev.main;
- import com.github.theholywaffle.teamspeak3.api.TextMessageTargetMode;
- import com.github.theholywaffle.teamspeak3.api.event.TS3EventAdapter;
- import com.github.theholywaffle.teamspeak3.api.event.TS3EventType;
- import com.github.theholywaffle.teamspeak3.api.event.TextMessageEvent;
- import com.github.theholywaffle.teamspeak3.api.wrapper.Client;
- public class ChatBot {
- final static int clientid = Main.api.whoAmI().getId();
- public static void start() {
- Main.api.registerEvent(TS3EventType.TEXT_PRIVATE, 0);
- Main.api.addTS3Listeners(new TS3EventAdapter() {
- @Override
- public void onTextMessage(TextMessageEvent e) {
- if(e.getTargetMode() == TextMessageTargetMode.CLIENT && e.getInvokerId() != clientid) {
- String msg = e.getMessage().toLowerCase();
- if(msg.startsWith("!verify")) {
- if(msg.contains(" ")) {
- Client c = Main.api.getClientByUId(e.getInvokerName());
- String Name = msg.split(" ")[1];
- if(Main.NameExist(Name)) {
- if(Main.getType(c.getUniqueIdentifier()) == 2) {
- int Rang = Main.getRang(c.getUniqueIdentifier());
- Main.api.addClientToServerGroup(Rang, c.getDatabaseId());
- Main.api.sendPrivateMessage(c.getId(), "Du bist nun Verifiziert!");
- }
- }
- }
- }
- }
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement