From fd831f2958fd17748915c9ded01a9dbde1549238 Mon Sep 17 00:00:00 2001 From: Lio Young Date: Mon, 17 May 2021 22:27:49 +0200 Subject: [PATCH] roleplay commands, pog --- src/modules/fun/hug.ts | 31 ++++++++++++++++--------------- src/utils/lingua | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/modules/fun/hug.ts b/src/modules/fun/hug.ts index ec2f53e..863527c 100644 --- a/src/modules/fun/hug.ts +++ b/src/modules/fun/hug.ts @@ -1,40 +1,41 @@ -import yiff from '../../utils/yiff'; +// @ts-nocheck import Command from '../../handler/structures/Command'; import { Context } from '../../utils/types'; import { MessageEmbed } from 'discord.js'; import lingua from '../../utils/lingua'; import replace from '../../utils/replace'; +import { request } from '../../utils/commmand.roleplay'; export = class Hug extends Command { constructor() { super({ name: "hug", description: "Hug somebody!", - // aliases: ["yip"], cooldown: 1, + usage: `<@User>` }) } async command(ctx: Context) { - let image = await yiff.sheri("hug") - let provider = "sheri.bot" - // @ts-ignore - if (ctx.message.mentions.members?.size === 0) return ctx.channel.send(replace(/ACTION/g, 'hug', lingua[ctx.settings.locale].RP_REQUIRE_MENTION)) - // @ts-ignore - if (ctx.message.mentions.members?.first()?.id === ctx.client.user?.id) return ctx.channel.send(replace(/ACTION/g, 'hug', lingua[ctx.settings.locale].RP_ME)) - // @ts-ignore - if (ctx.message.mentions.members?.first()?.id === ctx.author.id) return ctx.channel.send(replace(/ACTION/g, 'hug', lingua[ctx.settings.locale].RP_SELF)) + let action = "hug" + if (ctx.message.mentions.members?.size === 0) return ctx.channel.send(replace(/ACTION/g, action, lingua[ctx.settings.locale].RP_REQUIRE_MENTION)) + if (ctx.message.mentions.members?.first()?.id === ctx.client.user?.id) return ctx.channel.send(replace(/ACTION/g, action, lingua[ctx.settings.locale].RP_ME)) + if (ctx.message.mentions.members?.first()?.id === ctx.author.id) return ctx.channel.send(replace(/ACTION/g, action, lingua[ctx.settings.locale].RP_SELF)) + let users = [ctx.message.author.username, ctx.message.mentions.members?.first()?.user.username] + let { image, provider, line } = await request(action, ctx.settings.locale, users) if (ctx.settings.embeds) { - let Fox = new MessageEmbed() - .setImage(image.url) + let Action = new MessageEmbed().setImage(image.url) + if ((line && ctx.message.mentions.members?.size !== 0) && ctx.settings.interactiontext) Action.setDescription(line) + + Action .setFooter(`${ctx.config.variables.name} - Image provided by ${provider}`, ctx.config.variables.avatar) .setColor(ctx.config.variables.color) - ctx.channel.send(Fox) + ctx.channel.send(Action) } else { - - ctx.channel.send(image.url) + if ((line && ctx.message.mentions.members?.size !== 0) && ctx.settings.interactiontext) ctx.channel.send(`${line}\n\n${image.url}`) + else ctx.channel.send(image.url) } } } \ No newline at end of file diff --git a/src/utils/lingua b/src/utils/lingua index e6ba2d3..bda8736 160000 --- a/src/utils/lingua +++ b/src/utils/lingua @@ -1 +1 @@ -Subproject commit e6ba2d38b0b2c9d2e5ba2b0e5379a9a6178daa1b +Subproject commit bda873655d0aa46da44d904e1c0edd968c407556