diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-30 21:15:14 -0600 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-30 21:15:14 -0600 |
commit | af4278b2ee3b0bf9d541e13dfabbee7e8d5ee89b (patch) | |
tree | a58c290173e1d7c9e34c991cf3191596c36f730f /command_impls.js | |
parent | 128f3d63ea5ec3b225da8d0c7196ea4082389f9d (diff) |
add fomx
Diffstat (limited to 'command_impls.js')
-rw-r--r-- | command_impls.js | 14 |
1 files changed, 13 insertions, 1 deletions
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" }); + }); +} |