Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A "sendtextmessage" command returned with a server error. #351

Open
NIFO43 opened this issue Feb 4, 2020 · 3 comments
Open

A "sendtextmessage" command returned with a server error. #351

NIFO43 opened this issue Feb 4, 2020 · 3 comments
Labels

Comments

@NIFO43
Copy link

NIFO43 commented Feb 4, 2020

Why I became this error?

[16:39:41 ERROR] [com.github.theholywaffle.teamspeak3.EventManager]: Event listener threw an exception com.github.theholywaffle.teamspeak3.api.exception.TS3CommandFailedException: A "sendtextmessage" command returned with a server error. at com.github.theholywaffle.teamspeak3.api.CommandFuture.checkForFailure(CommandFuture.java:416) ~[?:?] at com.github.theholywaffle.teamspeak3.api.CommandFuture.getUninterruptibly(CommandFuture.java:357) ~[?:?] at com.github.theholywaffle.teamspeak3.TS3Api.sendPrivateMessage(TS3Api.java:3996) ~[?:?] at de.nifo.teamspeaksystem.listener.ClientJoinListener.onClientJoin(ClientJoinListener.java:20) ~[?:?] at com.github.theholywaffle.teamspeak3.api.event.ClientJoinEvent.fire(ClientJoinEvent.java:176) ~[?:?] at com.github.theholywaffle.teamspeak3.EventManager$ListenerTask.run(EventManager.java:150) ~[?:?] at com.github.theholywaffle.teamspeak3.TS3Query.lambda$submitUserTask$0(TS3Query.java:282) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_231] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_231] at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]

`public class ClientJoinListener extends TS3EventAdapter {

private TS3Api api;

public ClientJoinListener(TS3Api api) {
    this.api = api;
}

@Override
public void onClientJoin(final ClientJoinEvent event) {
    System.out.println("Test");
    Client client = api.getClientInfo(event.getClientId());
    api.sendPrivateMessage(client.getId(), "Hello!");
}

}

@TheRealDomm
Copy link

TheRealDomm commented Feb 5, 2020

just use public YourClass implements TS3Listener
then go ahed with
api.sendPrivateMessage(event.getClientId(), "Hello");

@rogermb
Copy link
Collaborator

rogermb commented May 4, 2020

Neat, the logger cuts off the second line of the error message :/
That line would usually contain the error name and ID, which would help us actually track down this issue. Without it, all I can do is guess:

  • Perhaps you're trying to send a message to a query client instead of a regular client. You should probably wrap that call to api.sendPrivateMessage in an if that checks for the client type, i.e.: if (client.isRegularClient()) { [...]
  • It could be that you're missing the required permissions to send private messages to clients, but that seems rather unlikely to me.

@Galileon-venta
Copy link

It could be, that a client disconnects in the time the api needs to go trough the code; I got this often:
A scanner client by ts-viewer/xyz connects and instantly disconnects again; I got a error because i cant send a message to someone who is offline.

Could this be the same Problem here?
Check your Teamspeak Console for the whole server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants