Warning: session_start(): open(/var/lib/php/sessions/sess_jpoln8ect7dbn9kkfitq0jc7f0, 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 {
db();
loadBots();
botSleep();
}
svoid loadBots {
cleanUpAndClear(bots);
for (S bot : config().bots)
bots.add(pair(bot, run(bot)));
}
answer {
lock dbLock();
if "add bot *" {
S id = formatSnippetID($1);
config().bots.remove(id);
config().bots.add(0, id);
loadBots();
ret "OK";
}
if "remove bot *" {
S id = formatSnippetID($1);
config().bots.remove(id);
loadBots();
ret "OK";
}
if "list bots"
ret structForUser(config().bots);
try answer scanMultipleBots(map(f second, bots), s);
}
static Config config() { ret uniq_sync(Config); }