Warning: session_start(): open(/var/lib/php/sessions/sess_e7olvugp4q6i4iu6d5ej798ifa, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
concept Config { new L bots; /* contains program IDs */ }
static new L> bots; // pair(program ID, main class)
p-subst { db(); loadBots(); botSleep(); }
svoid loadBots {
cleanUpAndClear(bots); for (S bot : config().bots) bots.add(pair(bot, runSubBot(bot)));
}
answer {
lock dbLock();
if "add bot *" {
setAddOrMoveToFront(config().bots, formatSnippetID($1));
loadBots(); ret "OK";
}
if "remove bot *" {
config().bots.remove(formatSnippetID($1));
loadBots(); ret "OK";
}
if "list bots" ret sfu(config().bots);
try answer scanMultipleBots(map(f second, bots), s);
}
static Config config() { ret uniq_sync(Config); }