Berikut adalah versi yang diperbaiki dari kode JavaScript yang diberikan:

const { v4 } = require('uuid');
const crypto = require('crypto');
const sharp = require('sharp');
const axios = require('axios');
const fetch = require('node-fetch');
const { SocksProxyAgent } = require('socks-proxy-agent');

let httpsAgent = new SocksProxyAgent(`socks5://184.178.172.25:15291`);
let handler = async (m, { conn, usedPrefix, command }) => {
  let q = m.quoted ? m.quoted : m;
  let mime = (q.msg || q).mimetype || q.mediaType || '';
  if (/image/g.test(mime)) {
    m.reply('On Progress, Please Wait');
    let toanim = await toAnime(await q.download());
    let img = JSON.parse(toanim).img_urls[1];
    let { data } = await conn.getFile(img);
    data = await crop(data);
    await m.reply(data);
  } else throw `Send/reply an image with command ${usedPrefix + command}`;
}

handler.help = ['ToAnime'];
handler.tags = ['tools'];
handler.command = /^(to|jadi)anime$/i;

module.exports = handler;


function signV1(obj) {
  function o(e, t) {
    var n = (65535 & e) + (65535 & t);
    return (((e >> 16) + (t >> 16) + (n >> 16)) << 16) | (65535 & n);
  }
  function i(e, t, n, r, i, a) {
    return o(((a = o(o(t, e), o(r, a))) << (i = i)) | (a >>> (32 - i)), n);
  }
  function a(e, t, n, r, o, a, s) {
    return i((t & n) | (~t & r), e, t, o, a, s);
  }
  function s(e, t, n, r, o
perbaiki kode js berikutconst v4 = requireuuid;const crypto = requirecrypto;const sharp = requiresharp;const axios = requireaxios;const fetch = requirenode-fetch;const SocksProxyAgent = requiresoc

原文地址: https://www.cveoy.top/t/topic/hVEy 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录