Warning: session_start(): open(/var/lib/php/sessions/sess_oq14rk6vqn6ho250oqed2moape, 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 GreeterBot > DynTalkBot {
S msg = "Welcome ! Rules and regulations apply. And stuff.";
long channelToGreetIn;
start {
useAGIBlueForDropPunctuation = false;
}
void onUserJoin(long userID, O... _) {
S msg2 = replace(msg, "", discordAt(userID));
if (channelToGreetIn == 0) setField(channelToGreetIn := preferredChannelID);
if (channelToGreetIn == 0) fail("Have no greeting channel");
}
S processSimplifiedLine(S s, O... _) {
try answer super.processSimplifiedLine(s, _); // adding authorized users etc.
s = dropPrefixOrNull(atSelf() + " ", s);
if (s == null) null;
if (eqic(s, "prefer this channel")) {
try answer checkAuth();
long channelID = longPar channelID(_);
if (channelID == 0) ret "No channel";
setField(channelToGreetIn := channelID);
ret "OK, will greet here from now on.";
}
if (eqic(s, "simulate greeting")) {
onUserJoin(longPar userID(_), _);
ret "Greeting simulated";
}
if (eqic(s, "get message"))
ret msg;
if (swic_trim(s, "set message:", m)) {
setField(msg := m.rest();
ret "Message changed to: " + msg;
}
null;
}
}