forked from Supositware/Haha-Yes
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
795 B
JavaScript
27 lines
795 B
JavaScript
6 years ago
|
const { Command } = require('discord.js-commando');
|
||
|
const Discord = require('discord.js');
|
||
|
const snekfetch = require('snekfetch');
|
||
|
module.exports = class DoggyCommand extends Command {
|
||
|
constructor(client) {
|
||
|
super(client, {
|
||
|
name: 'doggy',
|
||
|
group: 'fun',
|
||
|
memberName: 'doggy',
|
||
|
description: `Show a random doggy`,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
async run(message, { city }) {
|
||
|
const { body } = await snekfetch.get(`https://random.dog/woof.json`);
|
||
|
if (body.cod == '404') {
|
||
|
return message.say(`No results found for **${city}**`);
|
||
|
}
|
||
|
const dogEmbed = new Discord.RichEmbed()
|
||
|
.setColor("#ff9900")
|
||
|
.setTitle('Woof')
|
||
|
.setImage(body.url)
|
||
|
|
||
|
|
||
|
message.say(dogEmbed);
|
||
|
}
|
||
|
};
|