feature is not a function
Closed this issue · 0 comments
trende2001 commented
(node:6136) UnhandledPromiseRejectionWarning: TypeError: feature is not a function
the code is EXACTLY the same
const path = require('path')
const fs = require('fs')
module.exports = (client) => {
const readFeatures = (dir) => {
const files = fs.readdirSync(path.join(__dirname, dir))
for (const file of files) {
const stat = fs.lstatSync(path.join(__dirname, dir, file))
if (stat.isDirectory()) {
readFeatures(path.join(dir, file))
} else if (file !== 'load-features.js') {
const feature = require(path.join(__dirname, dir, file))
console.log(`Enabling feature "${file}"`)
feature(client)
}
}
}
readFeatures('.')
}