mirror of https://github.com/thaldrin/thaldrin.git
make the image focused commands quicker to make lol
This commit is contained in:
parent
4a48b3f2b0
commit
09eeed1961
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Bird extends Command {
|
export = class Bird extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -14,18 +14,10 @@ export = class Bird extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let { image, provider } = await request("bird")
|
let data = await request("bird")
|
||||||
// console.log({ image, provider })
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
if (context.settings.embeds) {
|
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(image[0])
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
|
||||||
}
|
return Embed.get()
|
||||||
else {
|
|
||||||
context.channel.send(image[0])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Cat extends Command {
|
export = class Cat extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -13,18 +13,10 @@ export = class Cat extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let { image, provider } = await request("cat")
|
let data = await request("cat")
|
||||||
// console.log({ image, provider })
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
if (context.settings.embeds) {
|
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(image[0])
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
|
||||||
}
|
return Embed.get()
|
||||||
else {
|
|
||||||
context.channel.send(image[0])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Fox extends Command {
|
export = class Fox extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -14,16 +14,9 @@ export = class Fox extends Command {
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let data = await request("fox")
|
let data = await request("fox")
|
||||||
if (context.settings.embeds) {
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(data.image.url)
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${data.provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
|
||||||
}
|
return Embed.get()
|
||||||
else {
|
|
||||||
context.channel.send(data.image.url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Hyena extends Command {
|
export = class Hyena extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -15,17 +15,9 @@ export = class Hyena extends Command {
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let data = await request("hyena")
|
let data = await request("hyena")
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
if (context.settings.embeds) {
|
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(data.image.url)
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${data.provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
return Embed.get()
|
||||||
}
|
|
||||||
else {
|
|
||||||
context.channel.send(data.image.url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Shibe extends Command {
|
export = class Shibe extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -13,18 +13,10 @@ export = class Shibe extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let { image, provider } = await request("shibe")
|
let data = await request("shibe")
|
||||||
// console.log({ image, provider })
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
if (context.settings.embeds) {
|
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(image[0])
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
|
||||||
}
|
return Embed.get()
|
||||||
else {
|
|
||||||
context.channel.send(image[0])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Context } from "@utils/types"
|
import { Context } from "@utils/types"
|
||||||
import { Command } from "@modules/eu/src/index"
|
import { Command } from "@modules/eu/src/index"
|
||||||
import request from "@utils/animals"
|
import request from "@utils/animals"
|
||||||
import { MessageEmbed } from "discord.js"
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
export = class Wolf extends Command {
|
export = class Wolf extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -14,17 +14,9 @@ export = class Wolf extends Command {
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
async run(context: Context): Promise<any> {
|
||||||
let data = await request("wolf")
|
let data = await request("wolf")
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
if (context.settings.embeds) {
|
|
||||||
let Embed = new MessageEmbed()
|
|
||||||
.setImage(data.image.url)
|
|
||||||
.setFooter(`Thaldrin - Image provided by ${data.provider}`, "https://thaldrin.media/avatar.png")
|
|
||||||
.setColor("ORANGE")
|
|
||||||
|
|
||||||
context.channel.send({ embeds: [Embed] })
|
return Embed.get()
|
||||||
}
|
|
||||||
else {
|
|
||||||
context.channel.send(data.image.url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Context } from "@utils/types"
|
||||||
|
import { Command } from "@modules/eu/src/index"
|
||||||
|
import { request } from "@utils/command.roleplay"
|
||||||
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
|
export = class Boop extends Command {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
name: "boop",
|
||||||
|
description: "Boop a fellow fur!",
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(context: Context): Promise<any> {
|
||||||
|
let data = await request("boop", context.settings.locale)
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
|
|
||||||
|
return Embed.get()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Context } from "@utils/types"
|
||||||
|
import { Command } from "@modules/eu/src/index"
|
||||||
|
import { request } from "@utils/command.roleplay"
|
||||||
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
|
export = class Cuddle extends Command {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
name: "cuddle",
|
||||||
|
description: "Cuddle a fellow fur!",
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(context: Context): Promise<any> {
|
||||||
|
let data = await request("cuddle", context.settings.locale)
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
|
|
||||||
|
return Embed.get()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Context } from "@utils/types"
|
||||||
|
import { Command } from "@modules/eu/src/index"
|
||||||
|
import { request } from "@utils/command.roleplay"
|
||||||
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
|
export = class Hold extends Command {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
name: "hold",
|
||||||
|
description: "Hold a fellow fur tight!",
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(context: Context): Promise<any> {
|
||||||
|
let data = await request("cuddle", context.settings.locale)
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
|
|
||||||
|
return Embed.get()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Context } from "@utils/types"
|
||||||
|
import { Command } from "@modules/eu/src/index"
|
||||||
|
import { request } from "@utils/command.roleplay"
|
||||||
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
|
export = class Hug extends Command {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
name: "hug",
|
||||||
|
description: "Hug a fellow fur!",
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(context: Context): Promise<any> {
|
||||||
|
let data = await request("hug", context.settings.locale)
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
|
|
||||||
|
return Embed.get()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Context } from "@utils/types"
|
||||||
|
import { Command } from "@modules/eu/src/index"
|
||||||
|
import { request } from "@utils/command.roleplay"
|
||||||
|
import EmbeddingHandler from "@utils/Embed"
|
||||||
|
|
||||||
|
export = class Lick extends Command {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
name: "lick",
|
||||||
|
description: "Lick someone!",
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(context: Context): Promise<any> {
|
||||||
|
let data = await request("lick", context.settings.locale)
|
||||||
|
let Embed = new EmbeddingHandler(context, data)
|
||||||
|
|
||||||
|
|
||||||
|
return Embed.get()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { MessageEmbed } from "discord.js";
|
||||||
|
import { Server, Context } from "@utils/types"
|
||||||
|
|
||||||
|
export default class EmbeddingHandler {
|
||||||
|
context: Context
|
||||||
|
image: string
|
||||||
|
provider: string
|
||||||
|
line?: string
|
||||||
|
constructor(context, data) {
|
||||||
|
this.context = context
|
||||||
|
this.image = [data.image].flat()[0]
|
||||||
|
this.provider = data.provider
|
||||||
|
this.line = data?.line
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
get() {
|
||||||
|
if (this.context.settings.embeds) {
|
||||||
|
let Embed = new MessageEmbed()
|
||||||
|
// @ts-ignore
|
||||||
|
.setImage(this.image)
|
||||||
|
.setFooter(`Thaldrin - Image provided by ${this.provider}`, "https://thaldrin.media/avatar.png")
|
||||||
|
.setColor("ORANGE")
|
||||||
|
if ((this.line && this.context.message.mentions.members.size !== 0) && this.context.settings.embeds) Embed.setDescription(`${this.line}`)
|
||||||
|
return this.context.channel.send({ embeds: [Embed] })
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ((this.line && this.context.message.mentions.members.size !== 0) && this.context.settings.embeds) return this.context.channel.send(`${this.line}\n\n${this.image}`)
|
||||||
|
return this.context.channel.send(`${this.line}\n\n${this.image}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,18 +22,18 @@ export default async function request(animal: animal) {
|
||||||
return { image: proxied, provider: "shibe.online" };
|
return { image: proxied, provider: "shibe.online" };
|
||||||
}
|
}
|
||||||
case "fox": {
|
case "fox": {
|
||||||
let image = await yiff.thaldrin("foxes")
|
let request = await yiff.thaldrin("foxes")
|
||||||
image.url = "https://proxy.thaldrin.media/" + image.url
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
return { image, provider: "thaldr.in" };
|
return { image, provider: "thaldr.in" };
|
||||||
}
|
}
|
||||||
case "hyena": {
|
case "hyena": {
|
||||||
let image = await yiff.thaldrin("yeens")
|
let request = await yiff.thaldrin("yeens")
|
||||||
image.url = "https://proxy.thaldrin.media/" + image.url
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
return { image, provider: "thaldr.in" };
|
return { image, provider: "thaldr.in" };
|
||||||
}
|
}
|
||||||
case "wolf": {
|
case "wolf": {
|
||||||
let image = await yiff.thaldrin("wolves")
|
let request = await yiff.thaldrin("wolves")
|
||||||
image.url = "https://proxy.thaldrin.media/" + image.url
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
return { image, provider: "thaldr.in" };
|
return { image, provider: "thaldr.in" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
import yiff from "./yiff";
|
||||||
|
|
||||||
|
type action =
|
||||||
|
"hug"
|
||||||
|
| "boop"
|
||||||
|
| "kiss"
|
||||||
|
| "lick"
|
||||||
|
| "hold"
|
||||||
|
| "cuddle"
|
||||||
|
| "nsfw_hug"
|
||||||
|
| "nsfw_kiss"
|
||||||
|
| "nsfw_lick"
|
||||||
|
| "nsfw_hold"
|
||||||
|
| "nsfw_cuddle"
|
||||||
|
| "nsfw_bulge"
|
||||||
|
|
||||||
|
function line(category: action) {
|
||||||
|
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function request(action: action, locale: string) {
|
||||||
|
switch (action) {
|
||||||
|
case "hug": {
|
||||||
|
let request = await yiff.sheri("hug")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "boop": {
|
||||||
|
let request = await yiff.sheri("boop")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "kiss": {
|
||||||
|
let request = await yiff.sheri("kiss")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "lick": {
|
||||||
|
let request = await yiff.sheri("lick")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "hold": {
|
||||||
|
let request = await yiff.sheri("hold")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "cuddle": {
|
||||||
|
let request = await yiff.sheri("cuddle")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_hug": {
|
||||||
|
let request = await yiff.sheri("nhug")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_kiss": {
|
||||||
|
let request = await yiff.sheri("nkiss")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_lick": {
|
||||||
|
let request = await yiff.sheri("nlick")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_hold": {
|
||||||
|
let request = await yiff.sheri("nhold")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_cuddle": {
|
||||||
|
let request = await yiff.sheri("ncuddle")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
case "nsfw_bulge": {
|
||||||
|
let request = await yiff.sheri("nbulge")
|
||||||
|
let image = "https://proxy.thaldrin.media/" + request.url
|
||||||
|
return { image, line: line(action), provider: "sheri.bot" };
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue