Hey NN,
ich habe ja mithilfe des NN Forums geschafft den Bot zu entwickeln, jetzt soll er jedoch weiterentwickelt werden und es kommt der Fehler:
[2018-09-11 16:18:18.799] [SEVERE] TS3 command error: {msg=convert error, id=1540}
Code
package data.main;
import com.github.theholywaffle.teamspeak3.TS3Api;
import com.github.theholywaffle.teamspeak3.api.event.*;
import com.github.theholywaffle.teamspeak3.api.wrapper.Client;
import com.github.theholywaffle.teamspeak3.TS3Config;
import com.github.theholywaffle.teamspeak3.TS3Query;
public class load {
public static TS3Api api;
public static TS3Config cfg = new TS3Config();
public static TS3Query qry = new TS3Query(cfg);
public static void main(String[] args) {
try {
cfg.setHost("91.200.100.200");
qry.connect();
api = qry.getApi();
api.selectVirtualServerByPort(9987);
api.login("serveradmin", "");
api.setNickname("Community-Bot");
System.out.println("Der Bot ist gestartet");
} catch (Exception e) {
System.out.println("Die Verbindung konnte nicht hergestellt werden!");;
}
api.registerAllEvents();
api.addTS3Listeners(new TS3Listener() {
@Override
public void onTextMessage(TextMessageEvent e) {
Client c = load.api.getClientInfo(e.getInvokerId());
if(e.getMessage().equalsIgnoreCase("!msg")); {
if(c.isInServerGroup(29)) {
load.api.removeClientFromServerGroup(29, c.getDatabaseId());
load.api.sendPrivateMessage(c.getId(), "We removed the group!");
}
else {
load.api.addClientToServerGroup(29, c.getDatabaseId());
load.api.sendPrivateMessage(c.getId(), "The Server added you to the group!");
}
}
}
@Override
public void onServerEdit(ServerEditedEvent e) {
System.out.println("Server edited by " + e.getInvokerName());
}
@Override
public void onClientMoved(ClientMovedEvent e) {
System.out.println("Client has been moved " + e.getClientId());
}
@Override
public void onClientLeave(ClientLeaveEvent e) {
// ...
}
@Override
public void onClientJoin(ClientJoinEvent e) {
Client c = load.api.getClientInfo(e.getInvokerId()); {
if(c.isInServerGroup(52)) {
load.api.sendPrivateMessage(c.getId(), "Hello Staff-Member, have a nice Day!");
}
else {
load.api.addClientToServerGroup(29, c.getDatabaseId());
load.api.sendPrivateMessage(c.getId(), "Hello Player, if you will write !msg, you get the No-Message Role");
}
}
}
@Override
public void onChannelEdit(ChannelEditedEvent e) {
// ...
}
@Override
public void onChannelDescriptionChanged(ChannelDescriptionEditedEvent e) {
// ...
}
@Override
public void onChannelCreate(ChannelCreateEvent e) {
}
@Override
public void onChannelDeleted(ChannelDeletedEvent e) {
// ...
}
@Override
public void onChannelMoved(ChannelMovedEvent e) {
}
@Override
public void onChannelPasswordChanged(ChannelPasswordChangedEvent e) {
// ...
}
@Override
public void onPrivilegeKeyUsed(PrivilegeKeyUsedEvent e) {
Client c = load.api.getClientInfo(e.getClientId());
load.api.sendPrivateMessage(c.getId(), "\r\n" + "INFO: The Server added you to a group. ");
}
});
}
}
Alles anzeigen