convertidor-toanime.js 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import uploadImage from '../lib/uploadImage.js';
  2. const handler = async (m, {conn, text, args, usedPrefix, command}) => {
  3. const q = m.quoted ? m.quoted : m;
  4. const mime = (q.msg || q).mimetype || q.mediaType || '';
  5. if (!/image/g.test(mime)) throw '⚠️ ¿𝐇𝐞𝐲 𝐧𝐨 𝐬𝐚𝐛𝐞𝐬 𝐜𝐨𝐦𝐨 𝐮𝐬𝐚𝐫 𝐞𝐬𝐭𝐞 𝐜𝐨𝐦𝐚𝐧𝐝𝐨 𝐩𝐞𝐧𝐝𝐞𝐣𝐨? 𝐫𝐞𝐬𝐩𝐨𝐧𝐝𝐞 𝐚 𝐮𝐧𝐚 𝐢𝐦𝐚𝐠𝐞𝐧';
  6. m.react(`⌛`)
  7. const data = await q.download?.();
  8. const image = await uploadImage(data);
  9. try {
  10. const anime = `https://api.lolhuman.xyz/api/imagetoanime?apikey=${lolkeysapi}&img=${image}`;
  11. await conn.sendFile(m.chat, anime, 'error.jpg', null, m, null, fake);
  12. m.react(`✅`)
  13. } catch (i) {
  14. try {
  15. const anime2 = `https://api.zahwazein.xyz/photoeditor/jadianime?url=${image}&apikey=${keysxxx}`;
  16. await conn.sendFile(m.chat, anime2, 'error.jpg', null, m, null, fake);
  17. m.react(`✅`)
  18. } catch (a) {
  19. try {
  20. const anime3 = `https://api.caliph.biz.id/api/animeai?img=${image}&apikey=caliphkey`;
  21. await conn.sendFile(m.chat, anime3, 'error.jpg', null, m, null, fake);
  22. m.react(`✅`)
  23. } catch (e) {
  24. m.reply(`\`\`\`⚠️ OCURRIO UN ERROR ⚠️\`\`\`\n\n> *Reporta el siguiente error a mi creador con el comando:*#report\n\n>>> ${e} <<<< `)
  25. console.log(e)
  26. m.react(`❌`)
  27. }}}};
  28. handler.help = ['toanime'];
  29. handler.tags = ['convertidor']
  30. handler.command = /^(jadianime|toanime)$/i;
  31. handler.register = true
  32. export default handler;