From e693b1e1e153099cc4d8d018c3cce92d22a7c034 Mon Sep 17 00:00:00 2001 From: Lio Young Date: Fri, 23 Apr 2021 03:55:39 +0200 Subject: [PATCH] add hug command and updat lingua base --- src/modules/roleplay/hug.ts | 40 +++++++++++++++++++++++++++++++++++++ src/utils/lingua | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/modules/roleplay/hug.ts diff --git a/src/modules/roleplay/hug.ts b/src/modules/roleplay/hug.ts new file mode 100644 index 0000000..e799408 --- /dev/null +++ b/src/modules/roleplay/hug.ts @@ -0,0 +1,40 @@ +import yiff from '../../utils/yiff'; +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'; + +export = class Fox extends Command { + constructor() { + super({ + name: "hug", + description: "Hug somebody!", + // aliases: ["yip"], + cooldown: 1, + }) + } + + 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)) + + 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/utils/lingua b/src/utils/lingua index 809a88c..c2836cd 160000 --- a/src/utils/lingua +++ b/src/utils/lingua @@ -1 +1 @@ -Subproject commit 809a88c19c0a249b804c3cec77de95c8ce80adec +Subproject commit c2836cda38b922626a3a2f532e40925437b53d0c