Chgange plugin loakder
This commit is contained in:
parent
1631d3cb9d
commit
3a76b57b33
1 changed files with 11 additions and 10 deletions
21
index.js
21
index.js
|
@ -6,17 +6,18 @@ const fs = require('fs')
|
|||
|
||||
module.exports.bot = []
|
||||
|
||||
const loadplug = (botno) => {
|
||||
const botplug = []
|
||||
const bpl = fs.readdirSync('plugins')
|
||||
for (const i in bpl) {
|
||||
if (!bpl[i].endsWith('.js')) {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
botplug.push(require(`./plugins/${bpl[i]}`))
|
||||
} catch (e) { console.log(e) }
|
||||
const botplug = []
|
||||
const bpl = fs.readdirSync('plugins')
|
||||
for (const i in bpl) {
|
||||
if (!bpl[i].endsWith('.js')) {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
botplug.push(require(`./plugins/${bpl[i]}`))
|
||||
} catch (e) { console.log(e) }
|
||||
}
|
||||
|
||||
const loadplug = (botno) => {
|
||||
botplug.forEach((plug) => {
|
||||
try {
|
||||
if (plug.load) {
|
||||
|
|
Loading…
Reference in a new issue