import axios from 'axios';

const handler = async (m, { conn, text, command }) => { if (!text) { throw *Example*: ${command} https://www.instagram.com/p/ABC123/; }

let url = encodeURIComponent(text); let apiKey = ${global.rose}; let apiUrl = https://api.itsrose.life/downloader/ig?url=${url}&apikey=Rk-Rk-arssdaebotsu;

try { conn.chatRead(m.chat); let startTime = new Date();

conn.chatRead(m.chat)
conn.sendMessage(m.chat, {
  react: {
    text: '🕒',
    key: m.key,
  }
})

let response = await axios.get(apiUrl);
let data = response.data;

if (data.status === true) {
  let result = data.result[0];
  let caption = `🐱 *Fetching:* ${(new Date() - startTime) / 1000} seconds`;
  conn.sendFile(m.chat, result.url, '', caption, m);
} else {
  throw '🐱 Failed to download content from Instagram.';
}

} catch (error) { console.error(error); m.reply('An error occurred while downloading content from Instagram.'); m.reply(`Detail Error:

${error.message}`); } };

handler.help = ['ig', 'igdl', 'instagram','dlig']; handler.tags = ['downloader']; handler.command = /^(ig|igdl|instagram|dlig)$/i; handler.register = true handler.limit = true

export default handler;

Instagram Downloader Bot - Download Instagram Posts & Reels

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

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