thaldrin/DiscordModules/Images/shibe.js
2019-11-10 09:42:09 +01:00

42 lines
983 B
JavaScript

const Command = require('../../src/structures/Command');
const yiff = require('yiff');
const { MessageEmbed } = require('discord.js');
module.exports = class Shibe extends Command {
constructor() {
super({
name: 'shiba',
description: 'Get a random shibe',
aliases: [ 'shib', 'shibe' ],
module: 'Images',
cooldown: 2,
guildOnly: false,
developerOnly: false,
nsfw: false
});
}
async command(ctx) {
const Server = await ctx.db.servers.get(ctx.guild.id);
let Settings;
if (Server === null) {
Settings = ctx.utils.db.defaults.server;
} else {
Settings = Server;
}
let req;
let Message;
await yiff.shibe.shibes().then((E) => (req = E));
console.log(req);
if (Settings.embeds) {
Message = new MessageEmbed()
.setColor(ctx.config.color)
.setImage(req)
.setFooter(`${ctx.client.user.username} - Provided by shibe.online`, ctx.client.user.avatarURL());
} else {
Message = `${req}`;
}
ctx.send(Message);
}
};