!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"; } } }