!752 static O mainBot; static S html(S uri, Map params) { if (!webAuthed()) { S editPW = trim(loadSecretTextFile("#1002192", "edit-pw")); if (empty(editPW)) ret "No special password set and you're not master-authed"; if (!eq(params.get("pw"), editPW)) ret "No password, bugger :)"; } S botID = params.get("bot"); StringBuffer buf; if (nempty(botID)) { O bot = getBot(botID); buf = (StringBuffer) getOpt(bot, "local_log"); print("1002241: Bot ID = " + botID + ", bot: " + bot + ", buf: " + (buf != null)); } else buf = (StringBuffer) get(mainBot, "print_log"); if (buf == null) ret "Bot not found"; int size = buf.length(); ret htag("p", "Log size: " + size) + htag("pre", htmlencode(buf)); } answer { if "print log size" { StringBuffer buf = cast get(mainBot, "print_log"); ret str(buf.length()); } if (!master()) ret null; if "clear print log" { StringBuffer buf = cast get(mainBot, "print_log"); int len = buf.length(); buf.setLength(0); ret "OK, cleared " + len + " characters"; } }