perbaiki kode di bawah ini let tiktok = requirexct007frieren-scraperlet readdirSync statSync unlinkSync existsSync readFileSync watch = requirefslet path join = requirepathasync
const { tiktok } = require('@xct007/frieren-scraper'); const fs = require('fs'); const path = require('path');
async function handler(m, { conn, args, __dirname }) { if (!args[0]) { return m.reply('Usage:\n!tiktok < link / url >\n\nExample: \n!tiktok https://vm.tiktok.com/ZS8w8TaD9/'); } try { await m.reply('Please wait...'); const obj = await tiktok.v1(args[0]); const file = path.join(__dirname, '../TMP/tiktok.mp4'); await fs.promises.writeFile(file, obj.play); await conn.sendFile(m.chat, file, '', '', m); fs.unlinkSync(file); } catch (e) { m.reply('Error: ' + e.message); } }
handler.help = ['tiktok
module.exports = handler
原文地址: https://www.cveoy.top/t/topic/gPQc 著作权归作者所有。请勿转载和采集!