Warning: session_start(): open(/var/lib/php/sessions/sess_lq2pddpahtrv6tm756hpmfg1p0, 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
!include once #1026298 // use JDA 4.0
standardBot1 TomiiBoiDiscordBot {
switchable S backendName = "tomiiBoiQA";
init {
if (myName == null) setField(myName := "Tomii");
preprocessAtSelfToMyName = true;
dropPunctuation = false;
escapeAtEveryone = true;
reactToBots = false;
}
sync S processSimplifiedLine(S s, O... _) {
try answer super.processSimplifiedLine(s, _);
new Matches m;
if (swic_trim(s, "gbot:", m))
ret gbot(m.rest(), paramsToMap(_));
O dbBot = dm_mainClass(backendName);
temp tempSetTL((ThreadLocal) getOpt(dbBot, 'opt_noDefault), true);
// guild logic
optPar Message msg;
Guild guild = msg == null ? null : msg.getGuild();
// add guild to server list
if (guild != null)
dm_callOpt(dbBot, "addServer", str(guild.getIdLong()), guild.getName());
temp tempSetTL((ThreadLocal) getOpt(dbBot, 'categoriesForRequest),
guild != null && guild.getIdLong() == 694186521875578911
? litset("btd") : null);
ret (S) call(dbBot, 'answer, s, "en");
}
S gbot(S query, Map map, O... _) {
LS l = regexpICFullMatch_groups("(\\d+) results? for[ :](.+)", query);
int results = 1;
if (l != null) {
results = parseInt(first(l));
query = unquote(trim(last(l)));
}
bool safeSearch = !discord_isNSFWChannel_gen(map.get('channel));
ret discord_google(query, paramsPlus(_, +results, +safeSearch));
}
}