Warning: session_start(): open(/var/lib/php/sessions/sess_1t4l6ar5jotocoen66h2ulcos6, 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;
preprocessAtSelfToMyName = 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.
new Matches m;
S sOld = s;
s = dropPrefixOrNull(myPrefix(), s);
if (s == null) {
print("no got prefix: " + quote(myPrefix()) + " / " + quote(sOld));
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)) {
try answer checkAuth(_);
setField(msg := m.rest();
ret "Message changed to: " + msg;
}
if (eqic(s, "help"))
ret trim([[
I am a simple greeter bot. Commands:
simulate greeting
get message
set message: Hello ! Bla bla...
prefer this channel
masters/add master/delete master
]]);
null;
}
}