aboutsummaryrefslogtreecommitdiff
path: root/command_impls.js
diff options
context:
space:
mode:
Diffstat (limited to 'command_impls.js')
-rw-r--r--command_impls.js14
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" });
+ });
+}