Advertisement
jensie1996

Cat Command discord

Jun 8th, 2019
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const discord = require("discord.js");
  2. const superAgent = require("superagent");
  3.  
  4. module.exports.run = async (bot, message, args) => {
  5.     var cat;
  6.  
  7.     cat = await superAgent
  8.         .get("http://aws.random.cat/meow");
  9.  
  10.     console.log(cat.body);
  11.  
  12.     while (cat.body.file.endsWith(".webm") || cat.body.file.endsWith(".mp4")) {
  13.         cat = await superAgent
  14.             .get("http://aws.random.cat/meow");
  15.         console.log(cat.body)
  16.     }
  17.  
  18.     var embed = new discord.RichEmbed()
  19.         .setColor("#880000")
  20.         .setTitle("Cat :cat:")
  21.         .setImage(cat.body.file);
  22.  
  23.     message.channel.send(embed);
  24.  
  25. }
  26.  
  27. module.exports.help = {
  28.     name: "cat",
  29.     description: "toont een kat"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement