diff --git a/Parsers/Dad Joke.js b/Parsers/Dad Joke.js new file mode 100644 index 0000000..4691e02 --- /dev/null +++ b/Parsers/Dad Joke.js @@ -0,0 +1,15 @@ +/* +activation_example:!dad +regex:!dad +flags:gmi +*/ + +var prompt = current.text.replace(/!dad/gmi, "").trim().substring(0, 1000); +var dadJoke = new sn_ws.RESTMessageV2(); +dadJoke.setEndpoint('https://icanhazdadjoke.com/'); +dadJoke.setHttpMethod("GET"); +dadJoke.setRequestHeader("Accept","text/plain"); +var chatResponse = dadJoke.execute(); +var chatResponseBody = chatResponse.getBody(); + +new x_snc_slackerbot.Slacker().send_chat(current, chatResponseBody, false);