Diesmon submitted a new resource:
OKlib - A lib that is OK. For other scripts to use.
Read more about this resource...
OKlib - A lib that is OK. For other scripts to use.
Read more about this resource...
Absolut Korrekt. Sogar nur für Entwickler interessant. Ist halt ne Library. Also um aufgaben für Entwickler abzunehmen.Is eher für Entwickler interessant oder?
Im endeffekt können wir hiermit das Rad (den SinusBot) nicht neu erfinden. Schließlich können wir nur auf Funktionen zugreifen die der SinusBot von Haus aus bietet.Ahh ok gut zu wissen,wofür ist OKlib denn da bzw. was wird dadurch in Zukunft denn möglich sein bei den Scripts?
var result = [];
var targetChannel = ChannelObject
var channelPool = channelObjectArray; //z.b. backend.getChannels();
for(var curChannel in channelPool){
if(channelPool[curChannel].parent().id() == targetChannel.id()){
result.push(channelPool[curChannel]);
}
}
var subchannels = OKlib.channel.getSubchannels(targetChannel, channelPool);
var subchannels = OKlib.channel.getSubchannels(targetChannel);
New function:
Added:
- client.urlToClient Parses a TS3-Client URL into a Client Object
- array.filterByAttribute Filters the elements from given Array for its Attributes value
Fixes:
- channel.getSubchannels added an optional channel array as last parameter. If not provided the function will use all channels
- general.getBots Returns now only Unique clients (even if bots are double connected with the same UID)
Added:
Fixed:
- helper.isInt New function that will test a number if it is a int
- string.matchUID Checks if a string is a valid UID (only syntax check)
- client.search Fixed a derpy singel client return when only one client was found. Will now give back a array regardless of the search results (Empty array if nothing was found)
- removed some double logging
- fixed a falsely used global var
Changed:
Removed:
- channel.getSubchannels changed the parentChannel handling. It can handle now a channelobject aswell as a channelID
- client.filterByClients the function got removed since it got obsolete and also had one little typo-bug
Added:
- helper.generatePassword Added the generate Password function to the lib which creates a random password
This update only fixes a wrong return value in one of the array functions. This means the client.isMemberOfAll() function should work correctly again. Thanks to @Relentless for reporting this bug.
lib (tm)
Forgot to increase the version string in the last update... NOT THIS TIME.
This is now the 1.0.8 and also reports as 1.0.8... hopefully.
2021-02-15T13:43:31+01:00 error on setTimeout/setInterval callback: Uncaught exception: TypeError: serverGroups.id is not a function at OKlib:493:44 result.push(serverGroups.id()); ^ Stack trace: TypeError: serverGroups.id is not a function at serverGroupParseIDs (OKlib:493:45) at Object.clientServerGroupsIsMemberOfOne (OKlib:385:23)