thaldrin/DiscordModules/Images/shibe.js

42 lines
963 B
JavaScript
Raw Normal View History

2019-11-10 08:42:09 +00:00
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));
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);
}
};