plant: log errors to log

This commit is contained in:
Cynthia Foxwell 2022-06-22 11:07:27 -06:00
parent 76ee7a789b
commit 3e08fa5afd

View file

@ -4,6 +4,8 @@ const CATEGORY = "misc";
const fetch = require("node-fetch");
const {tinycolor} = require("@ctrl/tinycolor");
const logger = require("./logger.js");
// taken from rot13.com
function rot(s, i) {
return s.replace(/[a-zA-Z]/g, function (c) {
@ -95,6 +97,7 @@ plant.callback = async function () {
try {
return {file: {file: await fetchPlant(), name: "plant.jpg"}};
} catch (err) {
logger.error("hf:cmd:plant", err);
return "<:trollhollow:851301241417498704> where plant (Encountered an error getting plant cam)";
}
};