!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 = dropPrefixOrNull(myPrefix(), 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)) { try answer checkAuth(); setField(msg := m.rest(); ret "Message changed to: " + msg; } null; } }