SyntaxIsHere

Untitled

Oct 14th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const request = require('request');
  2.  
  3. exports.run = (message, bot, send) => {
  4. let cn = request("http://api.adviceslip.com/advice", function(err, res, body) {
  5. try {
  6. let cnj = JSON.parse(body)
  7. message.channel.send(cnj.slip.advice)
  8. } catch (e) {
  9. return send("**Advice machine :b:roke**")
  10. }
  11. });
  12. }
Add Comment
Please, Sign In to add comment