From 7dcbc269756705560e745310103d2bc0171feccc Mon Sep 17 00:00:00 2001 From: Lio Young Date: Wed, 21 Apr 2021 02:26:57 +0200 Subject: [PATCH] add image commands --- src/modules/images/birb.ts | 32 ++++++++++++++++++++++++++++++++ src/modules/images/cat.ts | 33 +++++++++++++++++++++++++++++++++ src/modules/images/fox.ts | 24 +++++++++++++++++++----- src/modules/images/hyena.ts | 32 ++++++++++++++++++++++++++++++++ src/modules/images/shibe.ts | 33 +++++++++++++++++++++++++++++++++ src/modules/images/wolf.ts | 15 +++++++++++---- 6 files changed, 160 insertions(+), 9 deletions(-) create mode 100644 src/modules/images/birb.ts create mode 100644 src/modules/images/cat.ts create mode 100644 src/modules/images/hyena.ts create mode 100644 src/modules/images/shibe.ts diff --git a/src/modules/images/birb.ts b/src/modules/images/birb.ts new file mode 100644 index 0000000..1a17e91 --- /dev/null +++ b/src/modules/images/birb.ts @@ -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]) + } + } +} \ No newline at end of file diff --git a/src/modules/images/cat.ts b/src/modules/images/cat.ts new file mode 100644 index 0000000..180038b --- /dev/null +++ b/src/modules/images/cat.ts @@ -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]) + } + } +} \ No newline at end of file diff --git a/src/modules/images/fox.ts b/src/modules/images/fox.ts index 0d16d83..f55fdfb 100644 --- a/src/modules/images/fox.ts +++ b/src/modules/images/fox.ts @@ -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) + } } } \ No newline at end of file diff --git a/src/modules/images/hyena.ts b/src/modules/images/hyena.ts new file mode 100644 index 0000000..a6f10c9 --- /dev/null +++ b/src/modules/images/hyena.ts @@ -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) + } + } +} \ No newline at end of file diff --git a/src/modules/images/shibe.ts b/src/modules/images/shibe.ts new file mode 100644 index 0000000..54ea9b7 --- /dev/null +++ b/src/modules/images/shibe.ts @@ -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]) + } + } +} \ No newline at end of file diff --git a/src/modules/images/wolf.ts b/src/modules/images/wolf.ts index fc3fec6..7700359 100644 --- a/src/modules/images/wolf.ts +++ b/src/modules/images/wolf.ts @@ -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) + } } } \ No newline at end of file