mirror of
https://github.com/thaldrin/thaldrin.git
synced 2024-08-14 23:57:21 +00:00
make E net commands
This commit is contained in:
parent
c7a4cc1495
commit
54ead0c9ff
2 changed files with 40 additions and 9 deletions
|
@ -7,25 +7,24 @@ import lingua from "../../utils/lingua";
|
||||||
export = class E621 extends Command {
|
export = class E621 extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
name: "e621",
|
name: "e926",
|
||||||
description: "Get an Image from E621",
|
description: "Get an Image from E926",
|
||||||
aliases: ['e6', 'esix'],
|
aliases: ['e9', 'enine'],
|
||||||
cooldown: 1,
|
cooldown: 1
|
||||||
nsfw: true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async command(ctx: Context) {
|
async command(ctx: Context) {
|
||||||
// @ts-ignore
|
// @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))
|
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(" "))
|
let request = await yiff.e926(ctx.args.join(" "))
|
||||||
if (ctx.settings.embeds) {
|
if (ctx.settings.embeds) {
|
||||||
embed.setAuthor('e621.net', 'https://thaldrin.media/e621.png', `https://e621.net/post/${request[0].id}`)
|
embed.setAuthor('e926.net', 'https://thaldrin.media/e621.png', `https://e926.net/post/${request[0].id}`)
|
||||||
.setImage(request[0].file.url)
|
.setImage(request[0].file.url)
|
||||||
.setDescription(`[Link](https://e621.net/post/${request[0].id})`)
|
.setDescription(`[Link](https://e926.net/post/${request[0].id})`)
|
||||||
ctx.channel.send(embed)
|
ctx.channel.send(embed)
|
||||||
} else {
|
} else {
|
||||||
ctx.channel.send(`<https://e621.net/post/${request[0].id}>\n\n${request[0].file.url}`)
|
ctx.channel.send(`<https://e926.net/post/${request[0].id}>\n\n${request[0].file.url}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
src/modules/images/e926.ts
Normal file
32
src/modules/images/e926.ts
Normal file
|
@ -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(`<https://e621.net/post/${request[0].id}>\n\n${request[0].file.url}`)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue