I’d like to create a bot that can detect who is talking in a channel and log that data - I am looking basically for the same functionality as the blue circle that turns on when somone is talking/pressing push-to-talk key in a channel. Has anyone tried to do that before? I’ve been looking at some js libraries that integrate TS’s Server Querry, but as far as I can tell, those libraries aren’t built for this. Any ideas?
clientlist -voice
is the ServerQuery command you’d like to use here.
That’s what i can tell you.
Method 1: Using a QueryBot
in advance: I use the following api to create query bots using java:
note that there is no event (as far as I know) that waits for a client to speak, so it is best to use a timer that checks through (very unperformant):
@Scheduled(fixedDelay = 1000)
void logTalkData() {
for (Client client : de.querybot.bots.headbot.main.Main.api.getClients()) {
if (!client.isServerQueryClient() && client.isTalking()) {
System.out.println(Main.getTime() + "client " + client.getUniqueIdentifier() + " is talking.");
}
}
}
Method 2: Using Teamspeak5 RemoteApp
another method would be to set up a VM running a Ts5 client which communicates with a remote app and logs the events if there is a jsonObject with the type “talkStatusChanged”.
this would look like this:
{
"payload": {
"clientId": 13,
"connectionId": 2,
"isWhisper": false,
"status": 1
},
"type": "talkStatusChanged"
}
then write your script so that it only outputs requests where the status is set to “1”.
but note that you only get a clientID which changes when you reconnect (as far as I know) but if a client is talking and you get this message on your remote app you could make a request on a rest endpoint which then checks by id which client that was.
i repeat, these are only very very shaky and unperformant methods on my part, if someone has a better suggestion, happy to share.