!7 cmodule eeZee > DynDiscordHopper { S url = "https://4b559f3a.ngrok.io"; transient NotTooOften ntoError = notTooOften_1min(); @Override S answer(S input, Map map) { try answer super.answer(input, map); try { long time = sysNow(); S s = loadPageWithTimeout(60.0, url + hquery(message := input)); 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); } } }