Skip to content

Commit

Permalink
Merge pull request #220 from earlduque/fact
Browse files Browse the repository at this point in the history
Create a parser that generates a random fact when a user says !fact
  • Loading branch information
404paige authored Sep 30, 2023
2 parents 6571b11 + bbee4ff commit 1523b0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Parsers/Random fact generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
activation_example:!fact
regex:!fact
flags:gmi
*/
var prompt = current.text.replace(/!chatgpt/gmi, "").trim().substring(0, 1000);
var chatReq = new sn_ws.RESTMessageV2();
chatReq.setEndpoint('http://numbersapi.com/random');
chatReq.setHttpMethod("GET");
var chatResponse = chatReq.execute();
var chatResponseBody =chatResponse.getBody();

new x_snc_slackerbot.Slacker().send_chat(current, chatResponseBody, false);

0 comments on commit 1523b0a

Please sign in to comment.