roleplay commands, pog

This commit is contained in:
Lio Young 2021-05-17 22:27:49 +02:00
parent 39b8e045d5
commit fd831f2958
No known key found for this signature in database
GPG Key ID: 789795A11879E169
2 changed files with 17 additions and 16 deletions

View File

@ -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)
}
}
}

@ -1 +1 @@
Subproject commit e6ba2d38b0b2c9d2e5ba2b0e5379a9a6178daa1b
Subproject commit bda873655d0aa46da44d904e1c0edd968c407556