Advertisement
jensie1996

Dog Command Discord bot

Jun 8th, 2019
621
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 dog;
  6.  
  7.     dog = await superAgent
  8.         .get("https://random.dog/woof.json");
  9.  
  10.     console.log(dog.body);
  11.  
  12.     while (dog.body.url.endsWith(".webm") || dog.body.url.endsWith(".mp4")) {
  13.         dog = await superAgent
  14.             .get("https://random.dog/woof.json");
  15.         console.log(dog.body)
  16.     }
  17.  
  18.     var embed = new discord.RichEmbed()
  19.         .setColor("#880000")
  20.         .setTitle("Dog :dog:")
  21.         .setImage(dog.body.url);
  22.  
  23.     message.channel.send(embed);
  24.  
  25. }
  26.  
  27. module.exports.help = {
  28.     name: "dog",
  29.     description: "toont een hond"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement