bot.eval: inspect non errors only, not just all strings

This commit is contained in:
Cynthia Foxwell 2021-07-21 10:34:25 -06:00
parent 0b470e7cf7
commit 16cb278e6c

View file

@ -52,13 +52,13 @@ _eval.callback = async function (msg, line) {
try { try {
out = eval(line); out = eval(line);
if (out && out.then) out = await out; if (out && out instanceof Promise) out = await out;
} catch (err) { } catch (err) {
out = err.message ? err.message : err; out = err.toString();
errored = true; errored = true;
} }
out = typeof out == "string" ? out : inspect(out, {depth: 0}); out = errored ? out : inspect(out, {depth: 0});
const token = hf.config.token; const token = hf.config.token;
out = out.replace( out = out.replace(