Anyone could help me figure out how to make a serverquery send a private message to all clients when it connects to my teaspeak server?
if it helps, i'm using this node project to handle the Bot: https://github.com/macpie/node-Tea*Speak-api
i managed to subscribe to all events:
then create a function that executes on all events and filter then to use:
all the console.log are printed out and the function execute, it succefully set the new client with the function set_new_client(client_id, client) but at the send of this function it should send the user a message that everything went ok, but it does not send.
if it helps, i'm using this node project to handle the Bot: https://github.com/macpie/node-Tea*Speak-api
i managed to subscribe to all events:
JavaScript:
tsClient.subscribe('servernotifyregister', {
event: 'all',
specifier: 'all'
}, function(error, resp, req) {})
JavaScript:
tsClient.on('notify', function(eventName, resp) {
if (typeof(resp) == 'undefined') {
console.log('no server response');
return;
}
if (eventName.localeCompare('textmessage') == 0) {
if (resp.invokername.localeCompare(Globals.bot.name) == 0) {
return;
}
if (!resp.invokername.startsWith(Globals.bot.name)) {
command_interprerter(resp.invokerid, resp.msg, resp.invokername)
}
} else if (eventName.localeCompare('cliententerview') == 0) {
console.log('client enter view --')
console.log(resp.clid + ' | ' + resp.client_nickname)
get_client_info(resp.clid, function(client_id, client) {
if (client_id != -1) {
set_new_client(client_id, client);
console.log('seted new client')
}
});
} else if (eventName.localeCompare('clientleftview') == 0) {
remove_from_ts_members(resp.clid)
}
});