add image commands

This commit is contained in:
Lio Young 2021-04-21 02:26:57 +02:00
parent 663d306043
commit 7dcbc26975
No known key found for this signature in database
GPG Key ID: 789795A11879E169
6 changed files with 160 additions and 9 deletions

View File

@ -0,0 +1,32 @@
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js';
export = class Cat extends Command {
constructor() {
super({
name: "cat",
description: "Show a Cat",
cooldown: 1,
})
}
async command(ctx: Context) {
let image = await yiff.shibe("cats", 1)
let provider = "shibe.online"
if (ctx.settings.embeds) {
let Cat = new MessageEmbed()
.setImage(image[0])
.setFooter(`${ctx.config.variables.name} - Image provided by ${provider}`, ctx.config.variables.avatar)
.setColor(ctx.config.variables.color)
ctx.channel.send(Cat)
} else {
ctx.channel.send(image[0])
}
}
}

33
src/modules/images/cat.ts Normal file
View File

@ -0,0 +1,33 @@
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js';
export = class Birb extends Command {
constructor() {
super({
name: "birb",
description: "Show a Birb",
aliases: ["bird", 'birds'],
cooldown: 1,
})
}
async command(ctx: Context) {
let image = await yiff.shibe("birds", 1)
let provider = "shibe.online"
if (ctx.settings.embeds) {
let Birb = new MessageEmbed()
.setImage(image[0])
.setFooter(`${ctx.config.variables.name} - Image provided by ${provider}`, ctx.config.variables.avatar)
.setColor(ctx.config.variables.color)
ctx.channel.send(Birb)
} else {
ctx.channel.send(image[0])
}
}
}

View File

@ -1,18 +1,32 @@
import { Context } from '../../utils/types';
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js';
export = class Wolf extends Command {
export = class Fox extends Command {
constructor() {
super({
name: "fox",
description: "Show a Fox",
aliases: ["yip"],
cooldown: 0,
cooldown: 1,
})
}
async command(ctx: Context) {
// await find('foxes')
return console.log("Fox Command")
let image = await yiff.thaldrin("foxes")
let provider = "thaldr.in"
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)
}
}
}

View File

@ -0,0 +1,32 @@
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js';
export = class Hyena extends Command {
constructor() {
super({
name: "hyena",
description: "Show a Hyena",
aliases: ["yeen"],
cooldown: 1,
})
}
async command(ctx: Context) {
let image = await yiff.thaldrin("yeens")
let provider = "thaldr.in"
if (ctx.settings.embeds) {
let Hyena = 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(Hyena)
} else {
ctx.channel.send(image.url)
}
}
}

View File

@ -0,0 +1,33 @@
import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js';
export = class Shibe extends Command {
constructor() {
super({
name: "shibe",
description: "Show a Shibe",
aliases: ["shib"],
cooldown: 1,
})
}
async command(ctx: Context) {
let image = await yiff.shibe("shibes", 1)
let provider = "shibe.online"
if (ctx.settings.embeds) {
let Shibe = new MessageEmbed()
.setImage(image[0])
.setFooter(`${ctx.config.variables.name} - Image provided by ${provider}`, ctx.config.variables.avatar)
.setColor(ctx.config.variables.color)
ctx.channel.send(Shibe)
} else {
ctx.channel.send(image[0])
}
}
}

View File

@ -9,7 +9,7 @@ export = class Wolf extends Command {
name: "wolf",
description: "Show a Wolf",
aliases: ["awoo"],
cooldown: 0,
cooldown: 1,
})
}
@ -17,9 +17,16 @@ export = class Wolf extends Command {
let image = await yiff.thaldrin("wolves")
let provider = "thaldr.in"
ctx.settings.embeds ?
ctx.channel.send(new MessageEmbed().setImage(image.url).setFooter(`Thaldrin - Image provided by ${provider}`, ctx.config.variables.avatar).setColor(ctx.config.variables.color))
:
if (ctx.settings.embeds) {
let Wolf = 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(Wolf)
} else {
ctx.channel.send(image.url)
}
}
}