var c = sinusbot.getChannels();
for (var i = 0; i < c.length; i++){
for (var j = 0; j < c[i].clients.length; j++){
// do something
}
}
function findClientFromName(clientName) {
var allChannels = sinusbot.getChannels();
var foundClient = 'nothing';
for (var i = 0; i < allChannels.length; i++) {
for (var = j = 0; j < allChannels[j].clients.length; j++) {
}
}
return foundClient;
}
function findClientFromName(searchName) {
var foundClient = 'N0TH!NG';
searchName = searchName.toLowerCase();
allChannels = sinusbot.getChannels();
allChannels.forEach(function(channelInfo) {
channelClients = channelInfo['clients'];
channelClients.forEach(function(clientInfo) {
clientName = clientInfo['nick'];
clientID = clientInfo['id'];
clientUID = clientInfo['uid'];
clientServerGroups = clientInfo['g'];
clientNameParse = clientName.toLowerCase().split(" ")[0];
if (clientNameParse == searchName) {
foundClient = {
name: clientName,
id: clientID,
uid: clientUID,
groups: clientServerGroups
};
}
});
});
return foundClient;
}