Warning: session_start(): open(/var/lib/php/sessions/sess_8j3gi6c94bk8r8ivjvml1kkfgn, 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
cmodule Monkey > DynDiscordHopper {
S myName = "Monkey";
start {
dm_vmBus_onMessage_q('discordGuildJoin, voidfunc(Map map) {
ret unless map.get('module) == module();
postInChannel(preferredChannelID, "I sense a joiner");
});
dm_vmBus_onMessage_q('discordGuildLeave, voidfunc(Map map) {
ret unless map.get('module) == module();
postInChannel(preferredChannelID, "I sense a leaver");
});
}
@Override S answer(S input, Map map) {
ret mapEachLine_tlft_nempties(input, s -> {
new Matches m;
if "what's your name" ret myName;
if (swic_trim(s, "!power ", m)) {
ret or2(joinWithSpacedPlus(ai_powerWordsExpand(agiBlue_parsedPowerWords(), tok_splitAtPlus(m.rest()))), "No results");
}
try answer super.answer(s, map);
//try answer agiBlue_getAnswer(s);
try answer agiBlue_lookup(s, 'answer, 'is, 'means);
if (hasEllipsesInTheMiddle(s))
try answer random(listMinusElementIC(s, (LS) collect q(jsonDecodeList(loadPageWithParams("http://agi.blue/bot/allPagesContainingRegexp", q := "^" + ellipsisToDotPlusRegexp(s) + "$", max := 10)))));
S x = startsWithEndsWith_getRest_trim(s, "...", "...");
if (nempty(x))
try answer random(listMinusElementIC(s, (LS) collect q(jsonDecodeList(loadPageWithParams("http://agi.blue/bot/allPagesContaining", q := x, max := 10)))));
if (ewic_trim(s, "...", m))
try answer random(listMinusElementIC(s, (LS) collect q(jsonDecodeList(loadPageWithParams("http://agi.blue/bot/allPagesStartingWith", q := m.rest(), max := 10)))));
null;
});
}
}