!7 cmodule eeZee > DynDiscordHopper { S url = "tcp://0.tcp.ngrok.io:16892"; transient NotTooOften ntoError = notTooOften_1min(); @Override S answer(S input, Map map) { try answer super.answer(input, map); try { long time = sysNow(); temp DialogIO io = talkToTCPURL(url); io.sendLine(trim(firstLine(message))); new LS lines; while (addUnlessNull(lines, io.readLine()) != null); S s = lines_rtrim(lines); print("Got " + (s == null ? "timeout" : nChars(s)) + " in " + elapsedSeconds(time) + " s"); ret s; } catch e { if (!ntoError.yo()) null; S str = exceptionToStringShort(e); if (cic(str, "Server returned HTTP response code: 502")) // rough ret null with print("Bot is offline (502)"); print(e); ret "Error: " + shorten(100, str); } } }