From af4278b2ee3b0bf9d541e13dfabbee7e8d5ee89b Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Mon, 30 Dec 2024 21:15:14 -0600 Subject: add fomx --- command_impls.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'command_impls.js') diff --git a/command_impls.js b/command_impls.js index ee2db6d..4665044 100644 --- a/command_impls.js +++ b/command_impls.js @@ -50,7 +50,6 @@ export function blep(state) { export function catfact(state) { get("https://meowfacts.herokuapp.com/", (res) => { res.on("data", (d) => { - process.stdout.write(d); const obj = JSON.parse(d); const fact = obj.data[0]; return send(state, { content: fact }); @@ -60,3 +59,16 @@ export function catfact(state) { return send(state, { content: "failed to request fact" }); }); } + +export function fomx(state) { + get("https://randomfox.ca/floof/", (res) => { + res.on("data", (d) => { + const obj = JSON.parse(d); + const fomx = obj.image; + return send(state, { content: fomx }); + }); + }).on("error", (e) => { + console.error(e); + return send(state, { content: "failed to get fomx" }); + }); +} -- cgit v1.2.3