thaldrin/src/discord/commands/animals/fox.ts

33 lines
916 B
TypeScript
Raw Normal View History

2021-09-11 11:36:51 +00:00
import yiff from '../../../utils/yiff';
import { Command } from '@thaldrin/eu';
import { Context } from '../../../utils/types';
2021-04-21 00:26:57 +00:00
import { MessageEmbed } from 'discord.js';
2021-09-11 11:36:51 +00:00
import request from '../../../utils/animals';
2021-04-10 01:53:44 +00:00
2021-04-21 00:26:57 +00:00
export = class Fox extends Command {
2021-04-10 01:53:44 +00:00
constructor() {
super({
name: "fox",
description: "Show a Fox",
aliases: ["yip"],
2021-05-16 00:11:37 +00:00
cooldown: 2,
2021-04-10 01:53:44 +00:00
})
}
async command(ctx: Context) {
let { image, provider } = await request('fox')
2021-04-21 00:26:57 +00:00
if (ctx.settings.embeds) {
let Fox = new MessageEmbed()
.setImage(image.url)
.setFooter(`${ctx.config.variables.name} - Image provided by ${provider}`, ctx.config.variables.avatar)
.setColor(ctx.config.variables.color)
ctx.channel.send(Fox)
} else {
ctx.channel.send(image.url)
}
2021-04-10 01:53:44 +00:00
}
}