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);
  }
};