!7 set flag DynModule. // for transpilation cmodule GazelleMultiBot > DynGazelleBot { switchable int maxEvalResultLength = 100000; switchable double evalTimeout = 60.0; class Bot { S name; *() {} *(S *name) {} *(S *name, IVF1 *handlePost) {} swappable void handlePost(GazellePost post) {} GazelleBotCred cred() { ret GazelleBotCred(_user, _botToken, name); } } transient new L bots; start { dm_useLocalMechListCopies(); bots.add(new Bot("Math Bot", post -> gazelle_mathBot1_handlePost_2(_user, _botToken, post))); bots.add(new Bot("Code Safety Checker") { void handlePost(GazellePost post) { if (eqic(post.type, "JavaX Code")) gazelle_createPost(cred(), codeSafetyCheckResult(post.text), "Code Safety", refs := post.id); } }); bots.add(new Bot("Safe Code Runner") { void handlePost(GazellePost post) { if (eqic(post.type, "JavaX Code")) { S code = post.text; if (eq(codeSafetyCheckResult(code), "safe")) { S result = str(evalWithTimeoutOrException(evalTimeout, func { str(dm_javaEvalMedium(code)) })); S out = shorten(maxEvalResultLength, result); gazelle_createPost(cred(), out, "Code Result", refs := post.id); } } } }); } void handlePost(GazellePost post) { for (Bot bot : bots) pcall { bot.handlePost(post); } } }