fuck node
This commit is contained in:
parent
9ad8081971
commit
304d0ccb96
49 changed files with 1305 additions and 403 deletions
58
DiscordModules/Images/e621.js
Executable file
58
DiscordModules/Images/e621.js
Executable file
|
@ -0,0 +1,58 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
const yiff = require("yiff");
|
||||
const { MessageEmbed } = require("discord.js");
|
||||
let Icon =
|
||||
"https://cdn6.aptoide.com/imgs/0/7/f/07f23fe390d6d20f47839932ea23c678_icon.png?w=240";
|
||||
|
||||
module.exports = class E621 extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: "e621",
|
||||
description: "Get Images from e621",
|
||||
aliases: ["e6"],
|
||||
module: "Images",
|
||||
cooldown: 5,
|
||||
guildOnly: false,
|
||||
developerOnly: false
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
let Embed = new MessageEmbed().setColor("RED");
|
||||
if (!ctx.channel.nsfw) {
|
||||
Embed.setTitle("NSFW").setDescription(
|
||||
`This channel is not marked as NSFW, please mark it as such and rerun this command.`
|
||||
);
|
||||
return ctx.send(Embed);
|
||||
}
|
||||
if (ctx.args < 1) {
|
||||
Embed.setTitle("Search Terms").setDescription(
|
||||
"I need more tags than that to search for an Image."
|
||||
);
|
||||
return ctx.send(Embed);
|
||||
}
|
||||
|
||||
const Server = await ctx.db.servers.get(ctx.guild.id);
|
||||
let Settings;
|
||||
if (Server === null) {
|
||||
Settings = ctx.utils.db.defaults.server;
|
||||
} else {
|
||||
Settings = Server;
|
||||
}
|
||||
|
||||
let message = await ctx.send(`Searching...`);
|
||||
|
||||
let req;
|
||||
let Message;
|
||||
await yiff.e621.CubFilter(ctx.args.join(" ")).then(E => (req = E));
|
||||
if (Settings.embeds) {
|
||||
Message = new MessageEmbed().setImage(req.image);
|
||||
|
||||
message.delete();
|
||||
} else {
|
||||
Message = `${req.image}`;
|
||||
message.delete();
|
||||
}
|
||||
ctx.send(Message);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue