2022-01-13 00:56:24 +05:00
|
|
|
const Command = require("../../base/Command"),
|
2022-01-04 02:18:28 +05:00
|
|
|
fetch = require("node-fetch");
|
|
|
|
|
|
|
|
class Clyde extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: "clyde",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
|
|
|
aliases: [],
|
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
2022-01-13 00:26:23 +05:00
|
|
|
cooldown: 3000
|
2022-01-04 02:18:28 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args) {
|
|
|
|
const text = args.join(" ");
|
|
|
|
|
|
|
|
if (!text) return message.error("images/clyde:MISSING_TEXT");
|
|
|
|
|
|
|
|
const m = await message.sendT("misc:PLEASE_WAIT", null, {
|
|
|
|
prefixEmoji: "loading"
|
|
|
|
});
|
|
|
|
try {
|
|
|
|
const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=clyde&text=${text}`));
|
|
|
|
const json = await res.json();
|
2022-02-25 00:56:32 +05:00
|
|
|
message.reply({
|
2022-01-05 00:24:57 +05:00
|
|
|
files: [{
|
2022-01-24 01:34:45 +05:00
|
|
|
name: "clyde.png",
|
2022-01-05 00:24:57 +05:00
|
|
|
attachment: json.message
|
|
|
|
}]
|
|
|
|
});
|
2022-01-04 02:18:28 +05:00
|
|
|
m.delete();
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
2022-01-14 01:12:46 +05:00
|
|
|
m.error("misc:ERR_OCCURRED", null, {
|
2022-01-04 02:18:28 +05:00
|
|
|
edit: true
|
|
|
|
});
|
2022-01-13 00:26:23 +05:00
|
|
|
}
|
2022-01-04 02:18:28 +05:00
|
|
|
}
|
2022-01-13 00:26:23 +05:00
|
|
|
}
|
2022-01-04 02:18:28 +05:00
|
|
|
|
|
|
|
module.exports = Clyde;
|