Cara Memperbaiki Kode: Mengakses Folder dan Menangani Node_modules
import fs from 'fs'; import path from 'path'; import cp, { exec as _exec } from 'child_process'; import { promisify } from 'util';
let exec = promisify(_exec).bind(cp);
let handler = async (m, { conn, isROwner, usedPrefix, command, text }) => { if (!text.includes('./')) { throw `Masukkan Nama Foldernya!
Example: ${usedPrefix}${command} ./plugins`; }
if (text.split('/')[1] == 'node_modules') {
throw Tidak diizinkan untuk mengakses folder node_modules!;
}
// Kode lainnya... };
原文地址: http://www.cveoy.top/t/topic/nnp 著作权归作者所有。请勿转载和采集!