diff --git a/src/handler/client/Client.ts b/src/handler/client/Client.ts index aeeb4bf..af81919 100755 --- a/src/handler/client/Client.ts +++ b/src/handler/client/Client.ts @@ -52,11 +52,11 @@ export default class Thaldrin extends Client { const file = require(path.join(__dirname, '../../modules', module, command)); const Command = new file(); Command.module = module - Logger.info({ - type: "command:loaded", - command: Command.name, - message: `${Command.name} was loaded` - }) + // Logger.info({ + // type: "command:loaded", + // command: Command.name, + // message: `${Command.name} was loaded` + // }) this.commands.set(Command.name, Command); } catch (err) { console.error(err); diff --git a/src/modules/images/e621.ts b/src/modules/images/e621.ts new file mode 100644 index 0000000..d990013 --- /dev/null +++ b/src/modules/images/e621.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" +import embed from "../../utils/embed"; +import lingua from "../../utils/lingua"; +export = class E621 extends Command { + constructor() { + super({ + name: "e621", + description: "Get an Image from E621", + aliases: ['e6', 'esix'], + cooldown: 1, + nsfw: true + }) + } + + async command(ctx: Context) { + // @ts-ignore + if (ctx.args.length < 1) return ctx.channel.send(embed.setTitle(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS).setDescription(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS_DES)) + let request = await yiff.e621(ctx.args.join(" ")) + if (ctx.settings.embeds) { + embed.setAuthor('e621.net', 'https://thaldrin.media/e621.png', `https://e621.net/post/${request[0].id}`) + .setImage(request[0].file.url) + .setDescription(`[Link](https://e621.net/post/${request[0].id})`) + ctx.channel.send(embed) + } else { + ctx.channel.send(`\n\n${request[0].file.url}`) + + } + } +} \ No newline at end of file diff --git a/src/utils/embed.ts b/src/utils/embed.ts new file mode 100644 index 0000000..8607afd --- /dev/null +++ b/src/utils/embed.ts @@ -0,0 +1,5 @@ +import { MessageEmbed } from "discord.js"; +import config from '../../config' +export default new MessageEmbed() + .setColor(config.variables.color) + .setFooter(`${config.variables.name}`, config.variables.avatar) \ No newline at end of file