File size: 1,626 Bytes
2821330 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
module.exports.config = {
name: "humanize",
version: "1.0.0",
hasPermssion: 0,
credits: "Modified by Jonell Magallanes",
usePrefix: false,
description: "Converts AI-like text into humanized text.",
commandCategory: "Tool",
usages: "/humanize <text> or reply to a message with /humanize",
cooldowns: 5,
};
const axios = require("axios");
module.exports.run = async ({ api, event, args }) => {
let textToHumanize = "";
if (event.type === "message_reply" && event.messageReply.body) {
textToHumanize = event.messageReply.body;
} else if (args.length > 0) {
textToHumanize = args.join(" ");
} else {
return api.sendMessage("โ Please provide text to humanize by either typing it or replying to a message.", event.threadID, event.messageID);
}
const hs = await api.sendMessage("Humanizing text....", event.threadID, event.messageID);
const apiUrl = `https://ccprojectsapis.zetsu.xyz/api/aihuman?text=${encodeURIComponent(textToHumanize)}`;
try {
const response = await axios.get(apiUrl);
if (response.data.error === "No") {
const humanizedText = response.data.message2 || response.data.message;
api.editMessage(`๐๐๐บ๐ฎ๐ป๐ถ๐๐ฒ ๐ง๐ฒ๐
๐\nโโโโโโโโโโโโโโโโโโ\n${humanizedText}`, hs.messageID, event.threadID, event.messageID);
} else {
api.sendMessage("โ Error: Unable to process the request.", event.threadID, event.messageID);
}
} catch (error) {
api.sendMessage(`โ API Error: ${error.message}`, event.threadID, event.messageID);
}
}; |